I\'m brand new to Angular 2 and attempting to follow along with a video tutorial I found. Despite following all of the steps, Angular just won\'t work; I get the following e
I had this error even though I had everything that the answers above suggested in place. A simple edit in the app.module.ts
file ( like delete a bracket and put it back) did the trick.
In your main.ts
, you are bootstrapping both your AppModule and your App. It should just be the AppModule, which then bootstraps the App.
If you compare your main.ts to the docs you'll see the difference - just remove all references to App from main.ts
I've encountered this problem twice now. Both times were problems with how I was implementing my lazy loading. In my routing module I had my routes defines as:
{
path: "game",
loadChildren: () => import("./game/game.module").then(m => {m.GameModule})
}
But this is wrong. After the second => you don't need curly braces. it should look like this:
{
path: "game",
loadChildren: () => import("./game/game.module").then(m => m.GameModule)
}
Using ngcWebpack Plugin I got this error when not specifying a mainPath or entryModule.