You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Sentry's load instrumentation via the vite plugin for Svetlekit as outlined in the docs
Create a +layout.server.ts in the root of the project
See it re-run on every single route change despite having no dependencies on url/params/etc
Expected 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:
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 fetch instrumentation in SvelteKit, which might just fix the caching/invalidation issue.
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 handleFetch hook would be great.
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 route.id in the server load function (which our wrapper around load does) causes route invalidations. More details in #8801. We'll include the fix in the next SDK release (expect it at the beginning of next week).
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: