部署Angular2 App,出现未知的非描述性错误 [英] Deploying Angular2 App, getting unknown non-descriptive error

查看:111
本文介绍了部署Angular2 App,出现未知的非描述性错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

部署angular2应用后,在Firebug中得到此错误:app.js中的"TypeError:this._nativeError未定义".

Getting this error in firebug after angular2 app has been deployed : "TypeError: this._nativeError is undefined" in app.js.

* app.js是从npm run build.prod.aot(以及npm run build.prod)创建的javascript.

*app.js is the javascript that is created from npm run build.prod.aot (and also npm run build.prod).

App在本地运行良好,似乎只有在将其部署到独立的Web服务器后才会出现问题.我以为我在某个地方有一个小错别字,但该错误看起来很普通,而且我无法找到任何有关可能原因的结论.

App runs fine locally, it only seems to give me problems after I've deployed to a standalone web server. I assume I have a minor typo somewhere, but the error looks pretty generic and I can't find anything conclusive as to what might be the cause.

以前有没有人看过这个问题?还是有任何想法如何缩小搜索范围?

Has anyone seen this issue before? Or have any idea how to narrow down my search in finding it?

使用此种子项目: https://github.com/mgechev/angular-seed ,但评论/答案表明尽管使用了其他入门工具,其他人还是遇到了问题

Using this seed project: https://github.com/mgechev/angular-seed but comments/answers are suggesting that others have had issue despite using other starters

推荐答案

compiler.umd.js中约1604行,我添加了console.log来显示消息.

Around line 1604 in the compiler.umd.js I added a console.log to show me the message.

它是Object.defineProperty(BaseError.prototype,消息"定义)的set函数的一部分.

It is part of the set function of the Object.defineProperty(BaseError.prototype, "message" definition.

设置器正在将消息分配给_nativeError.message,但是_nativeError是未定义的,因此,该消息被炸毁,隐藏了REAL错误消息.

The setter is assigning the message to the _nativeError.message, but _nativeError is undefined and thus, THAT was blowing up, hiding the REAL error message.

因此,我只是放置了console.log来吐出所传递的消息,它向我显示了我所遇到的实际错误(模板错误).

So, I just put a console.log to spit out the message that was being passed in, and it showed me the actual error I had (a template error).

因此,这似乎是他们代码中的错误.

Therefore, this appears to be a bug in their code.

希望有帮助.

这篇关于部署Angular2 App,出现未知的非描述性错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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