core.umd.js中的{“isTrusted”:true}异常 [英] {"isTrusted":true} exception in core.umd.js

查看:6586
本文介绍了core.umd.js中的{“isTrusted”:true}异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我使用的是Angular 2,所有的东西都在Chrome中运行良好,但
我开始在Firefox中得到以下错误:

EXCEPTION:0 - {isTrusted:true} in core.umd.js


我不知道是什么原因这或它来自哪里,所以我甚至不知道从哪里开始调试它。我做了一些谷歌搜索,但找不到有用的东西。这是我在控制台中看到的图像:



有没有人知道这是什么意思?

解决方案

我记得我也有这个问题,我相信我把它追踪到下面。
$ b

{isTrusted:true} 是由我的ErrorHandler打印的请求的正文,要求。请求失败的原因是一个CORS问题。为了测试的目的,我在Tomcat的web.xml中为通配符设置了允许的来源:

 < init-param> 
< param-name> cors.allowed.origins< / param-name>
< param-value> *< / param-value>
< / init-param>

事实证明,至少在我使用的特定版本中,Firefox并不喜欢通配符和因此,尽管预检成功了,但却导致了一项失败的请求。将原点设置为合格的名称后,一切正常。就像你一样,我从来没有在Chrome浏览器中遇到这些问题。

看到这个问题



希望有助于追踪您的问题。


I'm using Angular 2 and everything is working great in Chrome, but I started getting the following error in Firefox:

EXCEPTION: 0 - {"isTrusted":true} in core.umd.js

I have no idea what is causing this or where it is coming from, so I don't even know where to begin with debugging it. I did some Googling, but couldn't find anything useful. Here is an image of what I'm seeing in the console:

Does anyone have any idea what this means?

解决方案

I remember I had that issue once, too, and I believe I tracked it down to the following.

{"isTrusted":true} was the body of a request that was printed by my ErrorHandler that caught failed requests. The cause for the failed request was a CORS issue. I had a wildcard set for allowed origins in my Tomcat's web.xml for testing purposes:

<init-param>
  <param-name>cors.allowed.origins</param-name>
  <param-value>*</param-value>
</init-param>

It turned out that Firefox, at least in that particular version I used, didn't like wildcards and, thus, resulted in a failed request although the preflight had succeeded. After setting the origin to a qualified name, everything worked fine. And just like you, I never had those issues in Chrome.

See this SO question, too

Hope that helps to track down your issue.

这篇关于core.umd.js中的{“isTrusted”:true}异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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