Angular 4 ng2-bootstrap-modal error:模块解析失败,意外令牌

时间:2017-10-30 16:59:35

标签: angular webpack angular-webpack-starter

我正在尝试部署一个有角度的4 + webpack应用程序并在构建

时遇到此错误
 ERROR in ./$$_gendir/~/ng2-bootstrap-modal/dist/dialog-wrapper.component.ngfactory.ts
    Module parse failed: D:\myapp\$$_gendir\node_modules\ng2-bootstrap-modal\dist\dialog-wrapper.component.ngfactory.ts Unexpected token (12:35)
    You may need an appropriate loader to handle this file type.
    | import * as i1 from 'ng2-bootstrap-modal/dist/dialog-wrapper.component';
    | import * as i2 from 'ng2-bootstrap-modal/dist/dialog.service';
    | const styles_DialogWrapperComponent:any[] = ([] as any[]);
    | export const RenderType_DialogWrapperComponent:i0.RendererType2 = i0.╔╡crt({encapsulation:2,
    |     styles:styles_DialogWrapperComponent,data:{}});
     @ ./$$_gendir/ClientApp/app/app.module.browser.ngfactory.ts 11:0-114
     @ ./ClientApp/boot.browser.ts

感谢

1 个答案:

答案 0 :(得分:0)

似乎有一个修复从webpack.config.js删除include: /ClientApp/。详情请见https://github.com/aspnet/JavaScriptServices/issues/1168