Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot run build:prod in ngx-admin #798

Open
wdajun opened this issue May 28, 2018 · 16 comments
Open

cannot run build:prod in ngx-admin #798

wdajun opened this issue May 28, 2018 · 16 comments

Comments

@wdajun
Copy link

wdajun commented May 28, 2018

Hi buddy,

I've setup project with latest version of ngx-admin and also use ng2-smart-table component, when I run with DEV mode, everything is good, but after I type npm run build:prod, I saw such error:

ERROR in : Unexpected value 'Ng2SmartTableModule in C:/my-project/my-admin/node_modules/ng2-smart-table/ng2-smart-table.module.d.ts' imported by the module 'AppModule in C:/my-project/my-admin/src/app/app.module.ts'. Please add a @NgModule
annotation.

app.module.ts:
...
import { Ng2SmartTableModule } from 'ng2-smart-table';
...

@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
AppRoutingModule,
Ng2SmartTableModule,
NgbModule.forRoot(),
ThemeModule.forRoot(),
CoreModule.forRoot(),
ToasterModule.forRoot(),
],
...

The version is 1.3.0 for ng2-smart-table. Angular version is 6.0.0, Could someone help me out of trap ? Thanks ~

@heightpi
Copy link

heightpi commented May 28, 2018

Experiencing the same issue

@wrappixel
Copy link

Expiriencing the same issue

@gagaXD
Copy link

gagaXD commented May 29, 2018

Same issue here, after migrating to angular 6

@RicardoDeWilde
Copy link

Took me a few hours to figure out that this only occurs using version 1.3.0.
As a workaround, using an older version of ng2-smart-table (1.2.2) 'npm run build:prod' works for me.

@wrappixel
Copy link

@RicardoDeWilde did you run with the latest Angular 6 ? bucause i tried with 1.2.2 but no luck.

@RicardoDeWilde
Copy link

@wrappixel Ah, sorry... Read over the Angular 6.0.0 part. No, I'm using Angular 5, but have experienced the same issue with ng2-smart-table 1.3.0. Thought this might also apply to 6.0.0.

On a side-note, I forgot to mention the I also cleared my node_modules folder before doing npm install

@gagaXD
Copy link

gagaXD commented May 30, 2018

@wrappixel I was having the same issue, and switching to 1.2.2 solved it.

My angular version :

Angular CLI: 6.0.5
Node: 8.11.1
OS: linux x64
Angular: 6.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package.json details

"ng2-smart-table": "1.2.2",

Maybe it's related to angular 6 version ( 6.0.0 vs 6.0.3) ?

@wrappixel
Copy link

wrappixel commented May 30, 2018

@gagaXD check the screenshot with version of ( 1.2.2 ):

https://ibb.co/hZKb5y
https://ibb.co/kOHUQy

@gagaXD
Copy link

gagaXD commented May 31, 2018

Here is full copy of ng version output :

Angular CLI: 6.0.5
Node: 8.11.1
OS: linux x64
Angular: 6.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.5
@angular-devkit/build-angular     0.6.5
@angular-devkit/build-optimizer   0.6.5
@angular-devkit/core              0.0.23
@angular-devkit/schematics        0.0.42
@angular/cdk                      5.2.5
@angular/cli                      6.0.5
@ngtools/json-schema              1.1.0
@ngtools/webpack                  6.0.5
@schematics/angular               0.6.5
@schematics/schematics            0.0.11
@schematics/update                0.6.5
rxjs                              6.2.0
typescript                        2.7.2
webpack                           4.8.3

I try to run my ng build --prod command without --aot, like in your screen, but it also works.

So, not really sure of what is causing this issue :/

@wrappixel
Copy link

@gagaXD Solved, it was my mistake in package.json file i was writing with cap "ng2-smart-table": "^1.2.2", instead of "ng2-smart-table": "1.2.2"

Thanks for your help.

@infuse89
Copy link
Contributor

#801 fixed this problem

@alexssandrog
Copy link

Hi, something new about this issue? I have the same problem...

@howardgod
Copy link

experience same issue with following setup.
Angular CLI: 1.7.4
Node: 7.10.0
OS: win32 x64
Angular: 5.2.11

my workaround is
ng build --prod --aot false

@nnixaa
Copy link
Contributor

nnixaa commented Jun 12, 2018

Should be fine in 1.3.1 now!

@Syperia
Copy link

Syperia commented Jun 13, 2018

Unfortunately, issue have returned in 1.3.2

ng build --prod produces
ERROR in : Unexpected value 'Ng2SmartTableModule in /project/node_modules/ng2-smart-table/ng2-smart-table.module.d.ts' imported by the module 'AppModule in /project/src/app/app.module.ts'. Please add a @NgModule annotation.

@nnixaa nnixaa reopened this Jun 13, 2018
@Syperia
Copy link

Syperia commented Jun 20, 2018

Forked and tested. Works ok with AOT in version 1.3.3. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants