-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
False positive pushState warnings when using Sentry #12177
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
Comments
Dealing with the same issue. Thank you for creating a reproduction! |
Hi Sentry SvelteKit maintainer here 👋 I'll take a look if we can fix this on our end. As far as I can tell from reading the sveltekit code, this only is a problem in dev mode, though, right? |
Hey, so I took a look and I understand now, why this happens. The reason is indeed that the warning is a false positive. So most importantly: Our SDK does not call SvelteKit looks at an error stack trace to determine if it should show the warning or not. If you use the Sentry SDK, the SDK will monkey patch I'll take a look if I can come up with a fix in SvelteKit for this. |
A possible fix could be to filter out any URLs that have node_modules etc in them. Another (hacky) way could be to have a wrapper that is invoked after a small timeout, which checks how many stack entries it has, and takes that as the base of things to substract (and that way recognizing any monkeyp atches), then removing itself in favor of the dev time check. |
Honestly, sounds good enough to me 😅 Are you fine if I submit a PR for this? |
Sure, go ahead! |
It appears this issue occurs in production as well, not just in development mode. Was there any PR submitted for this? |
Hi, sorry no news from my end. I got side-tracked with other stuff. Maybe I can take a stab at this during svelte summit :D |
Describe the bug
I'm getting the same false positive warnings as described in #11671 , specifically after installing Sentry using the wizard and default settings (as described in https://docs.sentry.io/platforms/javascript/guides/sveltekit/).
I've attached a minimal repo that's a fresh sveltekit install with Sentry added to it. The warning appears on the first page load after a hard refresh.
Reproduction
https://github.com/linsen/sveltekit-sentry-warning
Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: