Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
7.64.0
Framework Version
7.64.0
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
When using your SvelteKit SDK, and specifically your Vite plugin for SvelteKit, the preloading / SSR functionality of TanStack Query for Svelte seems broken.
- Clone my https://github.com/kevinrenskers/sveltequery-sentry-sveltekit repo and npm install
- npm run dev, open http://127.0.0.1:5173
- Open the javascript console and then click on the "Articles" link in the top
You will see that the posts array is first undefined, and then it gets data:

Now edit vite.config.ts
and remove sentrySvelteKit()
from the plugins. Restart the dev server and do the same thing again: start on the homepage and then go to articles. Now the posts array is immediately defined:

It does have a real effect in my website, where articles pop in a fraction of a second later instead of already being there. Basically SSR seems broken.
Expected Result
I don't know if the problem lies with your sentrySvelteKit
Vite plugin which modifies the fetch
function, or if the problem lies with Query which can't deal with these changes. But I would expect that installing your SvelteKit SDK and Vite plugin to not change the behavior of my site when using Query.
Also reported in their repo: TanStack/query#5871
Actual Result
See repro steps above
Metadata
Metadata
Assignees
Type
Projects
Status