【问题标题】:Angular 4 ng2-bootstrap-modal error: Module parse failed,Unexpected tokenAngular 4 ng2-bootstrap-modal 错误:模块解析失败,意外令牌
【发布时间】:2017-10-30 16:59:35
【问题描述】:

我正在尝试部署一个 Angular 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

谢谢

【问题讨论】:

    标签: angular webpack angular-webpack-starter


    【解决方案1】:

    似乎有一个从 webpack.config.js 中删除 include: /ClientApp/ 的修复程序。详情在这里:https://github.com/aspnet/JavaScriptServices/issues/1168

    【讨论】:

      猜你喜欢
      • 2022-11-05
      • 2019-03-31
      • 2020-11-20
      • 2021-11-26
      • 2023-03-27
      • 2019-02-15
      • 2020-02-27
      • 1970-01-01
      • 2021-04-26
      相关资源
      最近更新 更多