简体   繁体   English

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

[英]Angular 4 ng2-bootstrap-modal error: Module parse failed,Unexpected token

I'm trying to deploy an angular 4 + webpack app and got this error on build 我正在尝试部署Angle 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

thanks 谢谢

Seem there is a fix removing include: /ClientApp/ from webpack.config.js. 似乎有一个修复程序,其中include: /ClientApp/从webpack.config.js中删除include: /ClientApp/ details here: https://github.com/aspnet/JavaScriptServices/issues/1168 详细信息在这里: https : //github.com/aspnet/JavaScriptServices/issues/1168

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么会出现此错误 - 在 prod 构建中使用 ng2-bootstrap-modal 时“无法读取未定义的属性 '0'”? - why get this error - 'Cannot read property '0' of undefined' when use ng2-bootstrap-modal in prod build? 错误:模块解析失败:意外的字符“ @”角 - Error: Module parse failed: Unexpected character '@' Angular 模块解析失败:意外令牌 (4:0) - Module parse failed: Unexpected token (4:0) 从JavaScript打开ng2-bootstrap-modal dialogservice - Open ng2-bootstrap-modal dialogservice from JavaScript webpack 编译后 ng2-bootstrap-modal 不起作用 - ng2-bootstrap-modal doesn't work after webpack compile CSS 模块解析失败:意外的令牌 Angular 14? - CSS Module parse failed: Unexpected token Angular 14? Angular4 + Universal + ng-bootstrap出现“意外的令牌导入”错误 - “Unexpected token import” error with Angular4 + Universal + ng-bootstrap Angular:模块解析失败:意外令牌 (13:15) - Angular: Module parse failed: Unexpected token (13:15) NG SERVE - 错误:模块解析失败:意外字符“�”(1:0) - NG SERVE - Error: Module parse failed: Unexpected character '�' (1:0) 模块解析失败:意外字符'@'。 使用Angular 6 CLI针对组件获取此错误 - Module parse failed: Unexpected character '@'. Getting this error for component with Angular 6 CLI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM