question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Tried to find bootstrap code, but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins options.

See original GitHub issue

OS?

Windows 10

Versions.

Node: v7.2.0 npm 3.10.9 Angular: 2.0.0-beta.8

main.ts `import {platformBrowserDynamic} from ‘@angular/platform-browser-dynamic’; import {BrowserModule} from ‘@angular/platform-browser’; import {BrowserAnimationsModule} from ‘@angular/platform-browser/animations’; import {NgModule} from ‘@angular/core’; import {FormsModule, ReactiveFormsModule} from ‘@angular/forms’; import { MdAutocompleteModule, MdButtonModule, MdButtonToggleModule, MdCardModule, MdCheckboxModule, MdChipsModule, MdCoreModule, MdDatepickerModule, MdDialogModule, MdExpansionModule, MdGridListModule, MdIconModule, MdInputModule, MdListModule, MdMenuModule, MdNativeDateModule, MdPaginatorModule, MdProgressBarModule, MdProgressSpinnerModule, MdRadioModule, MdRippleModule, MdSelectModule, MdSidenavModule, MdSliderModule, MdSlideToggleModule, MdSnackBarModule, MdSortModule, MdTableModule, MdTabsModule, MdToolbarModule, MdTooltipModule, } from ‘@angular/material’; import {InputFormExample} from ‘./input-form-example’; import {HttpModule} from ‘@angular/http’; import {CdkTableModule} from ‘@angular/cdk’;

@NgModule({ exports: [ CdkTableModule, MdAutocompleteModule, MdButtonModule, MdButtonToggleModule, MdCardModule, MdCheckboxModule, MdChipsModule, MdCoreModule, MdDatepickerModule, MdDialogModule, MdExpansionModule, MdGridListModule, MdIconModule, MdInputModule, MdListModule, MdMenuModule, MdNativeDateModule, MdPaginatorModule, MdProgressBarModule, MdProgressSpinnerModule, MdRadioModule, MdRippleModule, MdSelectModule, MdSidenavModule, MdSliderModule, MdSlideToggleModule, MdSnackBarModule, MdSortModule, MdTableModule, MdTabsModule, MdToolbarModule, MdTooltipModule, ] }) export class PlunkerMaterialModule {}

@NgModule({

imports: [ BrowserModule, BrowserAnimationsModule, FormsModule, HttpModule, PlunkerMaterialModule, MdNativeDateModule, ReactiveFormsModule, ],

declarations: [InputFormExample], bootstrap: [InputFormExample], providers: [] })platformBrowserDynamic().bootstrapModule(AppModule); `

app.module.ts

`import { NgModule } from ‘@angular/core’; import { BrowserModule } from ‘@angular/platform-browser’; import { AppComponent } from ‘./app.component’; import {MdButtonModule, MdCheckboxModule} from ‘@angular/material’;

@NgModule({ imports: [ BrowserModule,MdButtonModule, MdCheckboxModule], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { }

` The log given by the failure.

Error: Tried to find bootstrap code, but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins options.

Full stack trace:

at Object.resolveEntryModuleFromMain (C:\Users\saish\Documents\my-app\node_modules@ngtools\webpack\src\entry_resolver.js:128:11) at AotPlugin._setupOptions (C:\Users\saish\Documents\my-app\node_modules@ngtools\webpack\src\plugin.js:138:50) at new AotPlugin (C:\Users\saish\Documents\my-app\node_modules@ngtools\webpack\src\plugin.js:23:14) at _createAotPlugin (C:\Users\saish\Documents\my-app\node_modules@angular\cli\models\webpack-configs\typescript.js:55:12) at Object.exports.getNonAotConfig (C:\Users\saish\Documents\my-app\node_modules@angular\cli\models\webpack-configs\typescript.js:70:19) at NgCliWebpackConfig.buildConfig (C:\Users\saish\Documents\my-app\node_modules@angular\cli\models\webpack-config.js:27:37) at Class.run (C:\Users\saish\Documents\my-app\node_modules@angular\cli\tasks\serve.js:37:98) at check_port_1.checkPort.then.port (C:\Users\saish\Documents\my-app\node_modules@angular\cli\commands\serve.js:103:26) at process._tickCallback (internal/process/next_tick.js:103:7)

npm ERR! Windows_NT 10.0.15063 npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “start” npm ERR! node v7.2.0 npm ERR! npm v3.10.9 npm ERR! code ELIFECYCLE npm ERR! my-app@0.0.0 start: ng serve npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the my-app@0.0.0 start script ‘ng serve’. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the my-app package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ng serve npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs my-app npm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm owner ls my-app npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\saish\Documents\my-app\npm-debug.log

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
Broccocommented, Aug 17, 2017

This issue does not appear to be CLI related, I’d suggest posting your question to a support-based forum such as StackOverflow or gitter.

0reactions
angular-automatic-lock-bot[bot]commented, Jun 3, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng build throws error: "Tried to find bootstrap code, but could ...
Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins options. My main file as specified in .angular-cli.
Read more >
Tried to find bootstrap code, but could not. Specify either ...
Tried to find bootstrap code, but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins ......
Read more >
Tried to find bootstrap code, but could not specify either ...
Error : Tried to find bootstrap code, but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the...
Read more >
angular/angular-cli - Gitter
Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins options. Error: Tried to find bootstrap code, but could...
Read more >
JavaScript - Bootstrap
Don't use data attributes from multiple plugins on the same element. For example, a button cannot both have a tooltip and toggle a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found