-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[Sveltekit] Sveltekit auto instrumentation in vite plugin causes load functions to invalidate on every route change #8610
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
Hi @madeleineostoja, thanks for reporting and I'm very sorry for making this so hard to track down. It seems like our fix from #8391 is flawed. Recently we were notified about a better way of patching the global I'll look into this soon. I'd be more than happy to get rid of our custom fetch instrumentation in SvelteKit anyway 😅 Also yet again another example why an actual client-side |
Hey @madeleineostoja, I finally had some time to look at this and it turns out it's not related to fetch for once. Instead, a simple access to |
The fix isn't released yet but I just merged it. It'll go out with the next release. |
Uh oh!
There was an error while loading. Please reload this page.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
7.57.0
Framework Version
Sveltekit 1.22.1
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
load
instrumentation via the vite plugin for Svetlekit as outlined in the docs+layout.server.ts
in the root of the projectExpected Result
Layout load should not re-run unless its dependencies change or its explicitly invalidated
Actual Result
Layout load is invalidated on every route change, due to Sentry's instrumentation of
load
.Adding
autoInstrument: false
to the vite plugin options resolves the issue.Took me AGES to debug why my loads were rerunning constantly, breaking my app (I hydrate stores when they first run, and rehydrate on manual invalidation). This should be a huge warning in the docs if its not fixable due to patching sveltekit's fetch at the moment.
The text was updated successfully, but these errors were encountered: