Angular 项目编译前运行正常,编译后运行报错
- 我的 Angular 项目,没有编译使用 ng serve --o 运行,浏览器中查看正常并且没有报错
使用:ng build --prod 编译后(编译中没有错误)拷贝到 tomcat 下能运行起来但是报错
StaticInjectorError(Platform: core)[class{constructor(e,t,n,i,o){this._overlay=e,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=l.a.EMPTY,this.vi
Jo @ main-es2015.5fbfc01bfefd391d0e70.js:1
handleError @ main-es2015.5fbfc01bfefd391d0e70.js:1
(anonymous) @ main-es2015.5fbfc01bfefd391d0e70.js:1
invoke @ polyfills-es2015.5663d97d2ce982b62083.js:1
run @ polyfills-es2015.5663d97d2ce982b62083.js:1
runOutsideAngular @ main-es2015.5fbfc01bfefd391d0e70.js:1
tick @ main-es2015.5fbfc01bfefd391d0e70.js:1
_loadComponent @ main-es2015.5fbfc01bfefd391d0e70.js:1
bootstrap @ main-es2015.5fbfc01bfefd391d0e70.js:1
(anonymous) @ main-es2015.5fbfc01bfefd391d0e70.js:1
_moduleDoBootstrap @ main-es2015.5fbfc01bfefd391d0e70.js:1
(anonymous) @ main-es2015.5fbfc01bfefd391d0e70.js:1
invoke @ polyfills-es2015.5663d97d2ce982b62083.js:1
onInvoke @ main-es2015.5fbfc01bfefd391d0e70.js:1
invoke @ polyfills-es2015.5663d97d2ce982b62083.js:1
run @ polyfills-es2015.5663d97d2ce982b62083.js:1
(anonymous) @ polyfills-es2015.5663d97d2ce982b62083.js:1
invokeTask @ polyfills-es2015.5663d97d2ce982b62083.js:1
onInvokeTask @ main-es2015.5fbfc01bfefd391d0e70.js:1
invokeTask @ polyfills-es2015.5663d97d2ce982b62083.js:1
runTask @ polyfills-es2015.5663d97d2ce982b62083.js:1
_ @ polyfills-es2015.5663d97d2ce982b62083.js:1
Promise.then (async)
g @ polyfills-es2015.5663d97d2ce982b62083.js:1
scheduleTask @ polyfills-es2015.5663d97d2ce982b62083.js:1
onScheduleTask @ polyfills-es2015.5663d97d2ce982b62083.js:1
scheduleTask @ polyfills-es2015.5663d97d2ce982b62083.js:1
scheduleTask @ polyfills-es2015.5663d97d2ce982b62083.js:1
scheduleMicroTask @ polyfills-es2015.5663d97d2ce982b62083.js:1
C @ polyfills-es2015.5663d97d2ce982b62083.js:1
then @ polyfills-es2015.5663d97d2ce982b62083.js:1
appInitializer @ main-es2015.5fbfc01bfefd391d0e70.js:1
runInitializers @ main-es2015.5fbfc01bfefd391d0e70.js:1
(anonymous) @ main-es2015.5fbfc01bfefd391d0e70.js:1
(anonymous) @ main-es2015.5fbfc01bfefd391d0e70.js:1
(anonymous) @ main-es2015.5fbfc01bfefd391d0e70.js:1
invoke @ polyfills-es2015.5663d97d2ce982b62083.js:1
onInvoke @ main-es2015.5fbfc01bfefd391d0e70.js:1
invoke @ polyfills-es2015.5663d97d2ce982b62083.js:1
run @ polyfills-es2015.5663d97d2ce982b62083.js:1
run @ main-es2015.5fbfc01bfefd391d0e70.js:1
bootstrapModuleFactory @ main-es2015.5fbfc01bfefd391d0e70.js:1
zUnb @ main-es2015.5fbfc01bfefd391d0e70.js:1
a @ runtime-es2015.d764840f684025ed091a.js:1
0 @ main-es2015.5fbfc01bfefd391d0e70.js:1
a @ runtime-es2015.d764840f684025ed091a.js:1
t @ runtime-es2015.d764840f684025ed091a.js:1
r @ runtime-es2015.d764840f684025ed091a.js:1
(anonymous) @ main-es2015.5fbfc01bfefd391d0e70.js:1
- 是什么问题?我真的没看懂。。。
- 是打开首页成功显示了,但是浏览器控制台中报错,并且有个 ng-zorro-antd 的 overlay 组件没有正常显示
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
StaticInjectorError错误一般来说是因为某个service没有provider引起。你可以检查一下这个包含overlay组件的页面的constructor(有5个参数,第一个参数应该就是那个overlay)里面注入的service,是否都有了provider,
或者这个constructor不是页面,而是zorro的overlay组件本身的constructor?你可以查看一下overlay组件的constructor是否有5个参数,第一个参数是否名字是overlay