-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metadata injection breaks SvelteKit error pages #593
Comments
Hey @fkling thanks for writing in and big thank you for doing all the detective work! We honestly had to laugh a bit because it's so obvious that this could happen but we never thought about it. We'll fix this in a minute by ensuring we always access
I generally agree but chances are this is happening somewhere else and, more importantly, it could also happen in user-code at any time. So it definitely makes sense for us to keep this in mind. I'll open a PR soon. |
On another note: Is there a reason you're using the vite plugin directly instead of |
@Lms24 Thank you for the fast response!
No particular reason. I've stumbled upon this setting via https://sentry.io/changelog/ignore-errors-that-dont-come-from-your-code/ and then https://docs.sentry.io/platforms/javascript/configuration/filtering/#using-thirdpartyerrorfilterintegration. Now that you mention it I remember that I read about |
Third party error filtering should work in I opened #594 to fix the bug. Expect it to be released soon. Note, if you switch to |
Environment
Steps to Reproduce
Added the following to our vite config:
Expected Result
Opening a page that would cause an
+error.svelte
page to be rendered works without problems in preview mode (vite preview
).Actual Result
The page doesn't render and the console shows the following error:
This is part of the generated and minified code:
So at first glance it appears that Sentry is using the wrong class to get the stack trace from. Looking at the unminified module code we can see why:
SvelteKit generates components named
Error
for+error.svelte
pages. Sentry is injected after SvelteKit's code generation and expectsError
to refer to the built-in value.Interestingly it works when referencing
Error
directly in the component somehow because that forces SvelteKit to use a different name for the component:I filed this as a bug here because even though I think SvelteKit should not shadow built-in classes, Sentry should be aware of the conventions that SvelteKit uses or at the very least account for the fact that
Error
might be overwritten.The text was updated successfully, but these errors were encountered: