Reputation: 494
When i need to open my angular project by using the command ng serve --open in cli. it is showing error 'ERROR in Tried to find bootstrap code,but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins options. '
Upvotes: 0
Views: 4122
Reputation: 8878
Make sure your main.ts have the exact following code:
import { enableProdMode } from "@angular/core";
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
import { AppModule } from "./app/app.module";
import { environment } from "./environments/environment";
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
Upvotes: 5
Reputation: 1
Please check if you have included the required bootstrap modules in the EntryModule
configuration of your application root module. Also, remember to include the style and js related files in your angular.json
or .angular-cli.json
depending on the version of angular you are using. Hope it helps.
Upvotes: -1