When trying to run an angular app I was getting the error:
ERROR in No NgModule metadata found for 'AppModule'.
The error could possibly be becuase of following reasons:
ERROR in No NgModule metadata found for 'AppModule'.
The error could possibly be becuase of following reasons:
- There is a statement of the form platformBrowserDynamic().bootstrapModule(App)
in main.ts file where App is not really a module. Solution is to reaplace App with AppModule - The patformBrowserDynamic variable is declared as a constant
const platform = platformBrowserDynamic(); platform.bootstrapModule(App);
Solution is remove const keyword - And sometimes if the compiler fails for any unknown reason, try editing app.module.ts file (like deleting and reinserting a character). After saving the file the app is automatically recompiled and starts working normally if it has already been started using ng serve or npm start.
Stackoverflow reference:
No comments:
Post a Comment