steveblue / angular2-rollup

CLI for bundling Angular with Rollup and Closure Compiler
121 stars 18 forks source link

Failed on NODE_ENV=prod npm start #8

Closed ghost closed 7 years ago

ghost commented 7 years ago

I had to update node-sass to latest for this to work, then on NODE_ENV=prod npm start I get this:

[11:21:0] LOG src/*.ts copied to tmp/*ts [11:21:0] LOG ngc started compiling ngfactory Error: Error at /Users/xxx/Projects/Angular2/angular2-rollup/main.prod.ts:9:36: Cannot find module './ngfactory/tmp/app/app.module.ngfactory'. at check (/Users/xxx/Projects/Angular2/angular2-rollup/node_modules/@angular/tsc-wrapped/src/tsc.js:31:15) at Tsc.typeCheck (/Users/xxx/Projects/Angular2/angular2-rollup/node_modules/@angular/tsc-wrapped/src/tsc.js:86:9) at /Users/xxx/Projects/Angular2/angular2-rollup/node_modules/@angular/tsc-wrapped/src/main.js:33:23 at process._tickCallback (internal/process/next_tick.js:103:7) at Module.runMain (module.js:607:11) at run (bootstrap_node.js:420:7) at startup (bootstrap_node.js:139:9) at bootstrap_node.js:535:3 Compilation failed [11:21:3] LOG ngc compiled /ngfactory [11:21:3] LOG Rollup started bundling ngfactory

any idea how to fix it? Thanks.

steveblue commented 7 years ago

Cannot find module './ngfactory/tmp/app/app.module.ngfactory' usually means AOT compile failed due to error in project code. Try to run ngc by itself and it should display issues.

steveblue commented 7 years ago

@youpage did you resolve your issue with AOT compile? If no response, I will close this issue.

ghost commented 7 years ago

Hi, The problem was in the dependencies. The version of @angular/compiler-cli and @angular/platform-server must be the same. Not sure if @angular/core version matter, but I keep them all at the same version 2.3.0 and it works fine.

Thanks.

steveblue commented 7 years ago

Yes, that would definitely be an issue. Thanks for getting back to me.