Angular 4 ng2-bootstrap-modal错误:模块解析失败,意外的令牌 [英] Angular 4 ng2-bootstrap-modal error: Module parse failed,Unexpected token

查看:81
本文介绍了Angular 4 ng2-bootstrap-modal错误:模块解析失败,意外的令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试部署一个Angular 4 + Webpack应用程序,并在构建时出现此错误

I'm trying to deploy an angular 4 + webpack app and got this error on build

 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

谢谢

推荐答案

似乎有一个修复程序,可以从webpack.config.js中删除include: /ClientApp/.此处的详细信息: https://github.com/aspnet/JavaScriptServices/issues/1168

Seem there is a fix removing include: /ClientApp/ from webpack.config.js. details here: https://github.com/aspnet/JavaScriptServices/issues/1168

这篇关于Angular 4 ng2-bootstrap-modal错误:模块解析失败,意外的令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆