Comments (5)
When you see "Script error." with the line number :0 it means that the browser is choosing not to give you the error message to prevent leaking information cross-origin to attackers. This is great for preventing a hostile website from trying to get information after <script src="https://yourbank.example.com/…">
but it's a hassle for sites which shard their JavaScript onto a separate hostname, enough so that Facebook & a few other large properties approached the browser vendors about providing an alternative. Unfortunately it's not trivial:
-
Set CORS headers on all of your JavaScript files - i.e.
static.example.org
would setAccess-Control-Allow-Origin: http://www.example.org
. -
Add the
<script crossorigin src="http://static.example.org/path/to/my.js"></script>crossorigin
attribute to your script tags onwww.example.org
:
You will then receive full error information from Firefox 13+; I'm not sure about the status of WebKit or IE but as of a few months ago this was not supported. See https://developer.mozilla.org/en-US/docs/HTML/Element/script#attr-crossorigin for more information and links to the mailing list posts and bug trackers.
Until support matures, the approach #14 took of simply ignoring messages which can't be worked on is probably your best alternative short of not sharding anything important - it's also necessary since even if you avoid this problem for your code you will see a HUGE amount of noise from JavaScript errors in buggy browser extensions, malware, buggy antivirus, tampering proxies, and even things like external Facebook / Twitter / disqus, etc. failures caused by anything from transient bugs to horrible network connectivity.
from sentry-javascript.
Hopefully will be irrelevant in our 1.0 release. Reopen if it still happens.
from sentry-javascript.
@mattrobenolt: this is really an aside as I think the most common cause of this actually has nothing to do with raven - it's simply a case of sites using domain sharding and not being able to see their own code's errors.
from sentry-javascript.
@acdha You're completely right. We've actually been diving into this today to figure out what our options are.
By default, Script error.
is now being ignored, and we're going to document how to make your errors parseable.
from sentry-javascript.
@acdha Also, it specifically applies on window.onerror. If you explicitly try...catch exceptions and send that, it works.
With TraceKit, we're getting a lot of monkey patching of libraries for free and it seems like this is the route we'll have to take. We'll monkey patch functions to wrap them in try...catch handlers.
from sentry-javascript.
Related Issues (20)
- Add `server.address` attribute to `http.client` spans HOT 1
- Remix backend errors captured but code is not shown (missing context-line) HOT 4
- Crons Next.js auto-detection for Vercel does not work with App Router
- Add all Web Vitals to Replay Breadcrumbs HOT 1
- Capturing messages or exceptions from library won't be included in the Sentry client of the application HOT 3
- Ember Canary ember-release Test Failed
- nextjs-app-dir (canary) Test Failed
- Type mismatch when upgrading from 7.109.0 to 7.110.1 HOT 10
- The INP parameter is not displayed on the dashboard if the tunnel option is active HOT 17
- [@sentry/nextjs] v7.110.x locks @sentry/webpack-plugin to an outdated version causing project not found 404 error HOT 5
- Replay hinders performance on Angular apps HOT 1
- Backport `7.111.0`
- Add Profiling to CDN bundles HOT 1
- web-vitals not logging - except INP HOT 9
- Improve error throwing behaviour in browser integration test HOT 3
- unmeet peers HOT 4
- Receiving 404 for loader bundle version 7.111 HOT 3
- Not able to import and use 'httpClientIntegration' from @sentry/integrations HOT 11
- nextjs-14 (latest) Test Failed
- nextjs-14 (canary) Test Failed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-javascript.