I create application using angular cli and use backend proxy to handle backend and using polymer(vaadin) it work correctly until I update to angular cli 1.0.0-beta.22 it give Error
Tried to find bootstrap code, but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins options.
proxy.conf.json
{
"/api": {
"target": "http://127.0.0.1:3000",
"secure": false
}
}
main-polymer.ts
document.addEventListener('WebComponentsReady', () => {
require('./main.ts');
});
main.ts
import './polyfills.ts';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { AppModule } from './app/';
if (environment.production) {
enableProdMode();
}
// platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule);
how can I correct this?.
This is caused by Angular CLI
latest update. In the latest update, webpack searches for boostrap Module in main.ts
top level. In main-polymer.ts
, main.ts
is wrapped by addEventListener
so webpack can't find the bootstrap module that's why it reports an error.
Further reference github.com/angular/angular-cli/issues/2887
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With