angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

No any error output when used `ng serve --aot` in project which has errors

Open vadjs opened this issue 10 years ago • 31 comments

Please provide us with the following information:

No any error output when used ng serve --aot in project which has errors(compilation fails).

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Linux(Ubuntu 16.04)

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: local (v1.0.0-beta.17, branch: master) node: 6.7.0 os: linux x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

The log given by the failure.

Normally this include a stack trace and some more information.

I getting this log with "infinite building": ng serve --aot Could not start watchman; falling back to NodeWatcher for file system events. Visit http://ember-cli.com/user-guide/#watchman for more info. ** NG Live Development Server is running on http://localhost:4200. ** 23% building modules 109/109 modules 0 active But nothing of errors.

Mention any other details that might be useful.

With normal ng-serve project successfully builds but has intentional error which appears in browser console - not imported "angular2-text-mask" package(but it's functionality used in template).

Thanks! We'll be in touch soon.

vadjs avatar Oct 12 '16 13:10 vadjs

Does it repeatedly rebuild as well, is that it?

filipesilva avatar Oct 14 '16 18:10 filipesilva

No, it's just keep in this state permanently. No any rebuild.

vadjs avatar Oct 17 '16 15:10 vadjs

I faced this as well.

ng serve --aot simply hangs at 20%.

ng build --aot showed me the problem.

AppModule is not an NgModule
Error: AppModule is not an NgModule

Simon-Briggs avatar Oct 20 '16 05:10 Simon-Briggs

same here

AppModule is not an NgModule Error: AppModule is not an NgModule

inska avatar Oct 25 '16 06:10 inska

Same here with beta.19-3.

Both outputs from serve --aot and build --aot happening to me.

For serve --aot, if I navigate to http://localhost:4200 while it's waiting, it adds this new line to the terminal console (not the browser console, the browser just times out after a while):

webpack: wait until bundle finished: /

P.S.

Exact ng serve --aot message:

** NG Live Development Server is running on http://localhost:4200. **
 20% building modules 85/85 modules 0 active
webpack: wait until bundle finished: /
webpack: wait until bundle finished: /

As mentioned above the webpack lines are only when I try to browse to the site.

Exact build -prod --aot message:

Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
 10% building modules 5/6 modules 1 active ...eligy/routing-angular-cli/src/main.tsError: AppModule is not an NgModule
    at AotPlugin.getNgModuleMetadata (/Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/angular-cli/node_modules/@ngtools/webpack/src/plugin.js:247:19)
    at AotPlugin._processNgModule (/Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/angular-cli/node_modules/@ngtools/webpack/src/plugin.js:230:42)
    at /Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/angular-cli/node_modules/@ngtools/webpack/src/plugin.js:206:23
 10% building modules 6/6 modules 0 activeAppModule is not an NgModule
Error: AppModule is not an NgModule
    at AotPlugin.getNgModuleMetadata (/Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/angular-cli/node_modules/@ngtools/webpack/src/plugin.js:247:19)
    at AotPlugin._processNgModule (/Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/angular-cli/node_modules/@ngtools/webpack/src/plugin.js:230:42)
    at /Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/angular-cli/node_modules/@ngtools/webpack/src/plugin.js:206:23

The message AppModule is not an NgModule in the line 10% building modules 6/6 modules 0 activeAppModule is not an NgModule is shown in red while the rest of the message is shown in normal black color.

Meligy avatar Oct 31 '16 11:10 Meligy

I have upgraded my test repo to beta.19-3 if this helps with testing:

https://github.com/meligy/routing-angular-cli

Meligy avatar Oct 31 '16 12:10 Meligy

same here

erycson avatar Nov 01 '16 13:11 erycson

Same problem here. Not with the AppModule but with another module.

masterfix avatar Nov 03 '16 13:11 masterfix

Same here.

montella1507 avatar Nov 09 '16 03:11 montella1507

Same problem here

10% building modules 2/2 modules 0 activeError: AppModule is not an NgModule
    at AotPlugin.getNgModuleMetadata (C:\Users\Irvin\WebstormProjects\nexus4_angular_cli\node_modules\@ngtools\webpack\src\plugin.js:247:19)
    at AotPlugin._processNgModule (C:\Users\Irvin\WebstormProjects\nexus4_angular_cli\node_modules\@ngtools\webpack\src\plugin.js:230:42)
    at C:\Users\Irvin\WebstormProjects\nexus4_angular_cli\node_modules\@ngtools\webpack\src\plugin.js:206:23
    at process._tickCallback (internal/process/next_tick.js:103:7)
AppModule is not an NgModule
Error: AppModule is not an NgModule
    at AotPlugin.getNgModuleMetadata (C:\Users\Irvin\WebstormProjects\nexus4_angular_cli\node_modules\@ngtools\webpack\src\plugin.js:247:19)
    at AotPlugin._processNgModule (C:\Users\Irvin\WebstormProjects\nexus4_angular_cli\node_modules\@ngtools\webpack\src\plugin.js:230:42)
    at C:\Users\Irvin\WebstormProjects\nexus4_angular_cli\node_modules\@ngtools\webpack\src\plugin.js:206:23
    at process._tickCallback (internal/process/next_tick.js:103:7)

irvjc82 avatar Nov 09 '16 14:11 irvjc82

+1 Have the same issue with @ngtools/webpack and a lazy route

unsafecode avatar Nov 10 '16 09:11 unsafecode

+1 what @unsafecode said, same problem with @ngtools/webpack and a lazy route.

ajantsch avatar Nov 10 '16 18:11 ajantsch

same here activeError: AppModule is not an NgModule

riparrag avatar Nov 10 '16 19:11 riparrag

Same here

Judahh avatar Nov 11 '16 13:11 Judahh

angular-cli: 1.0.0-beta.19-3 node: 6.9.1 os: win32 x64

Error: LazyLoadedModule is not an NgModule
    at AotPlugin.getNgModuleMetadata (root_folder\node_modules\@ngtools\webpack\src\plugin.js:247:19)
    at AotPlugin._processNgModule (root_folder\node_modules\@ngtools\webpack\src\plugin.js:230:42)
    at AotPlugin._processNgModule (root_folder\node_modules\@ngtools\webpack\src\plugin.js:239:33)
    at root_folder\node_modules\@ngtools\webpack\src\plugin.js:206:23

In app.routing.ts:

      {
        path: 'lazy_loaded',
        loadChildren: 'app/lazy_loaded/lazy_loaded.module#LazyLoadedModule'
      }

mallim avatar Nov 13 '16 02:11 mallim

+1 and looks like the compiler-cli does not get the correct annotations of my app.module.ts

getNgModuleMetadata of StaticSymbol {
  filePath: '/Users/indooorsman/workspace/projects/web/yingke/server/ykly-toc-web/src/main/webapp/spa_src/src/app/app.module.ts',
  name: 'AppModule',
  members: undefined }
get annotations: []
Error: AppModule is not an NgModule
    at AotPlugin.getNgModuleMetadata (/Users/indooorsman/workspace/projects/web/yingke/server/ykly-toc-web/src/main/webapp/spa_src/node_modules/@ngtools/webpack/src/plugin.js:249:19)
    at AotPlugin._processNgModule (/Users/indooorsman/workspace/projects/web/yingke/server/ykly-toc-web/src/main/webapp/spa_src/node_modules/@ngtools/webpack/src/plugin.js:230:42)

indooorsman avatar Nov 16 '16 03:11 indooorsman

same here "angular-cli": "1.0.0-beta.19-3"

** NG Live Development Server is running on http://localhost:4200. **
 10% building modules 2/2 modules 0 active(node:1276) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: AppModule is not an NgModule
 20% building modules 84/84 modules 0 active

ovrmrw avatar Nov 19 '16 07:11 ovrmrw

Still in beta.20-4

ctrl-brk avatar Nov 20 '16 08:11 ctrl-brk

Same problem with 1.0.0-beta.21

dmittendorf avatar Nov 28 '16 20:11 dmittendorf

same thing here, seems like caused by this issue

ng serve just freezes

d668 avatar Dec 06 '16 13:12 d668