weixin_39886841
weixin_39886841
2021-01-12 11:11

"Javascript error: Script error. on line 0"

First, thanks for a great library!

I'm wondering about an event we are getting with the message Javascript error: Script error. on line 0. Our whitelistUrls is only including our own js files.

Currently I see these events coming from different browsers:

30 Firefox 30.0 30 Chrome 35.0.1916.153 8 Safari 6.1.4 6 Safari 6.0 3 Safari 7.0.4 2 ChromeiOS 35.0.1916.41 2 Chrome 35.0.1916.114 2 Safari 7.0.3 1 Chrome 34.0.1847.131 1 Chrome 33.0.1750.154

In the source code Raven.js already set up filters for Script error https://github.com/getsentry/raven-js/blob/master/src/raven.js#L66

But should Javascript error: Script error. on line 0 also be added by default?

I guess the event I'm seeing is related "script being pulled in from an external domain and CORS" as described in http://blog.errorception.com/2012/04/script-error-on-line-0.html

该提问来源于开源项目:getsentry/sentry-javascript

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

9条回答

  • weixin_39586353 weixin_39586353 4月前

    What is the exact error message being sent? Is it a different case or something?

    点赞 评论 复制链接分享
  • weixin_39886841 weixin_39886841 4月前

    so I cannot reproduce the error, but as you see some users with different browsers get this error. The message shown in Sentry is Javascript error: Script error. on line 0, so I guess that's the exact error message. And as the Script error in L66 is not a regexp, our error is not the ignoreErrors list.

    点赞 评论 复制链接分享
  • weixin_39886841 weixin_39886841 4月前

    But I guess I can get the message from our nginx if you want it. But shouldn't it be the same as reported by Sentry?

    点赞 评论 复制链接分享
  • weixin_39586353 weixin_39586353 4月前

    Yeah, that's good enough. Are all those other browser being reported as this exact literal string? Or do you see other variants? If so, I'll add this one to the list.

    点赞 评论 复制链接分享
  • weixin_39886841 weixin_39886841 4月前

    I see these variations: Javascript error: Script error on line 0 (IE) Javascript error: Script error. on line 0 (all the other browsers)

    点赞 评论 复制链接分享
  • weixin_39586353 weixin_39586353 4月前

    lol

    点赞 评论 复制链接分享
  • weixin_39886841 weixin_39886841 4月前

    For once, the feedback from IE seems sane... : )

    点赞 评论 复制链接分享
  • weixin_39886841 weixin_39886841 4月前

    224

    点赞 评论 复制链接分享
  • weixin_39586353 weixin_39586353 4月前

    Closed with #224

    点赞 评论 复制链接分享