You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No any error output when used ng serve --aot in project which has errors #2667
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).
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.
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)
I have this problem with angular-cli: 1.0.0-beta.22-1
Same code worked fine with version 1.0.0-beta.19-3
EDIT: From comments on #3157
I was over-eager and set typescript to 2.1.4. Downgrading TypeScript to 2.0.10 avoids the AppModule is not an NgModule error.
You should use ng init --skip-npm to diff your package.json with the default. Or create a fresh project somewhere else ng new --skip-npm fresh-ng-project and use your favorite diff tool to compare your package.json with the default.
After you've double-checked your package.json, npm install
If that doesn't fix it, some people have said changes they made to tsconfig.json caused the problem. So review that diff as well.
Otherwise, review how your module is exported. In my project, one module was export default class MyModule {} export default no longer works.
Remove default, if this is a lazy-loaded module in the router, you will need to add #MyModule loadChildren: 'app/path/to/my.module#MyModule'
getting below error while running ng build command.
No errors
Error: No errors
at validate (/home/meghad/testingWorkspace/web/node_modules/extract-text-webpack-plugin/schema/validator.js:10:9)
at Function.ExtractTextPlugin.extract (/home/meghad/testingWorkspace/web/node_modules/extract-text-webpack-plugin/index.js:188:3)
at /home/meghad/testingWorkspace/web/node_modules/angular-cli/models/webpack-build-utils.js:72:77
at Array.map (native)
at Object.makeCssLoaders (/home/meghad/testingWorkspace/web/node_modules/angular-cli/models/webpack-build-utils.js:69:53)
at Object.getWebpackCommonConfig (/home/meghad/testingWorkspace/web/node_modules/angular-cli/models/webpack-build-common.js:77:65)
at new NgCliWebpackConfig (/home/meghad/testingWorkspace/web/node_modules/angular-cli/models/webpack-config.js:22:49)
at Class.exports.default.Task.extend.run (/home/meghad/testingWorkspace/web/node_modules/angular-cli/tasks/build-webpack.js:18:22)
at Class.Command.extend.run (/home/meghad/testingWorkspace/web/node_modules/angular-cli/commands/build.js:60:26)
at Class. (/home/meghad/testingWorkspace/web/node_modules/angular-cli/ember-cli/lib/models/command.js:152:17)
at tryCatch (/home/meghad/testingWorkspace/web/node_modules/es6-promise/dist/es6-promise.js:410:12)
at invokeCallback (/home/meghad/testingWorkspace/web/node_modules/es6-promise/dist/es6-promise.js:425:13)
at /home/meghad/testingWorkspace/web/node_modules/es6-promise/dist/es6-promise.js:172:16
at flush (/home/meghad/testingWorkspace/web/node_modules/es6-promise/dist/es6-promise.js:121:5)
at nextTickCallbackWith0Args (node.js:419:9)
at process._tickCallback (node.js:348:13)
Activity
filipesilva commentedon Oct 14, 2016
Does it repeatedly rebuild as well, is that it?
vadjs commentedon Oct 17, 2016
No, it's just keep in this state permanently. No any rebuild.
Simon-Briggs commentedon Oct 20, 2016
I faced this as well.
ng serve --aot simply hangs at 20%.
ng build --aot showed me the problem.
inska commentedon Oct 25, 2016
same here
Meligy commentedon Oct 31, 2016
Same here with beta.19-3.
Both outputs from
serve --aotandbuild --aothappening to me.For
serve --aot, if I navigate tohttp://localhost:4200while it's waiting, it adds this new line to the terminal console (not the browser console, the browser just times out after a while):P.S.
Exact
ng serve --aotmessage:As mentioned above the webpack lines are only when I try to browse to the site.
Exact
build -prod --aotmessage:The message
AppModule is not an NgModulein the line10% building modules 6/6 modules 0 activeAppModule is not an NgModuleis shown in red while the rest of the message is shown in normal black color.Meligy commentedon Oct 31, 2016
I have upgraded my test repo to beta.19-3 if this helps with testing:
https://github.com/meligy/routing-angular-cli
erycson commentedon Nov 1, 2016
same here
masterfix commentedon Nov 3, 2016
Same problem here. Not with the AppModule but with another module.
montella1507 commentedon Nov 9, 2016
Same here.
irvjc82 commentedon Nov 9, 2016
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)unsafecode commentedon Nov 10, 2016
+1 Have the same issue with
@ngtools/webpackand a lazy route7 remaining items
dmittendorf commentedon Nov 28, 2016
Same problem with 1.0.0-beta.21
d668 commentedon Dec 6, 2016
same thing here, seems like caused by this issue
ng servejust freezesarlowhite commentedon Dec 13, 2016
I have this problem with angular-cli: 1.0.0-beta.22-1
Same code worked fine with version 1.0.0-beta.19-3
EDIT: From comments on #3157
I was over-eager and set typescript to 2.1.4. Downgrading TypeScript to 2.0.10 avoids the AppModule is not an NgModule error.
aaronleestic commentedon Dec 13, 2016
My ng serve hanging went away after I updated /src/tsconfig.json to the one generated by beta.22
d668 commentedon Dec 14, 2016
the way i deal with it is I run
ng buildand see where is the error in the code actuallyfrank-mendez commentedon Dec 14, 2016
+1 20% building modules 84/84 modules 0 activewebpack: wait until bundle finished:
What is the possible solution for this?
arlowhite commentedon Dec 14, 2016
From what I've seen here and on #3157 and #3426
Most problems seem to be caused by people jumping ahead to a newer version of Angular or TypeScript.
Double-check package.json
For an angular-cli 1.0.0-beta.22-1 project, you should be on:
"@angular/compiler-cli": "2.2.3"(under devDependencies)You should use
ng init --skip-npmto diff your package.json with the default. Or create a fresh project somewhere elseng new --skip-npm fresh-ng-projectand use your favorite diff tool to compare your package.json with the default.After you've double-checked your package.json,
npm installIf that doesn't fix it, some people have said changes they made to tsconfig.json caused the problem. So review that diff as well.
Otherwise, review how your module is exported. In my project, one module was
export default class MyModule {}export default no longer works.
Remove
default, if this is a lazy-loaded module in the router, you will need to add#MyModuleloadChildren: 'app/path/to/my.module#MyModule'meghadureja commentedon Jan 28, 2017
getting below error while running ng build command.
No errors
Error: No errors
at validate (/home/meghad/testingWorkspace/web/node_modules/extract-text-webpack-plugin/schema/validator.js:10:9)
at Function.ExtractTextPlugin.extract (/home/meghad/testingWorkspace/web/node_modules/extract-text-webpack-plugin/index.js:188:3)
at /home/meghad/testingWorkspace/web/node_modules/angular-cli/models/webpack-build-utils.js:72:77
at Array.map (native)
at Object.makeCssLoaders (/home/meghad/testingWorkspace/web/node_modules/angular-cli/models/webpack-build-utils.js:69:53)
at Object.getWebpackCommonConfig (/home/meghad/testingWorkspace/web/node_modules/angular-cli/models/webpack-build-common.js:77:65)
at new NgCliWebpackConfig (/home/meghad/testingWorkspace/web/node_modules/angular-cli/models/webpack-config.js:22:49)
at Class.exports.default.Task.extend.run (/home/meghad/testingWorkspace/web/node_modules/angular-cli/tasks/build-webpack.js:18:22)
at Class.Command.extend.run (/home/meghad/testingWorkspace/web/node_modules/angular-cli/commands/build.js:60:26)
at Class. (/home/meghad/testingWorkspace/web/node_modules/angular-cli/ember-cli/lib/models/command.js:152:17)
at tryCatch (/home/meghad/testingWorkspace/web/node_modules/es6-promise/dist/es6-promise.js:410:12)
at invokeCallback (/home/meghad/testingWorkspace/web/node_modules/es6-promise/dist/es6-promise.js:425:13)
at /home/meghad/testingWorkspace/web/node_modules/es6-promise/dist/es6-promise.js:172:16
at flush (/home/meghad/testingWorkspace/web/node_modules/es6-promise/dist/es6-promise.js:121:5)
at nextTickCallbackWith0Args (node.js:419:9)
at process._tickCallback (node.js:348:13)
iamgmd commentedon Jan 28, 2017
getting same as meghadureja on ng build or ng serve
happens on windows and mac with prompts in administrator mode.
node: 6.9.4
npm: 3.10.10
angular-cli: 1.0.0-beta.26
angular: 2.4.5
router: 3.4.5
equinox commentedon Jan 28, 2017
@iamgmd
Hi there, you're after #4264 for the current issue, with a working workaround in that thread.
iamgmd commentedon Jan 28, 2017
@equinox
Thanks, just seen that after I posted. Thanks for redirect.
hansl commentedon Feb 3, 2017
Closing this as fixed.
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.