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
Svelte 5 is not yet stable. We can't bump peer dependencies before it goes stable because we can't guarantee support yet. This issue serves as a collection of things we need to do for Svelte 5 support at this time. We can do some preparations beforehand but we won't guarantee support.
Problem Statement
Our @sentry/svelte SDK is not fully compatible with Svelte 5. This has two reasons
Svelte 5 requires type: "module" and exports in package.json
Svelte 5 no longer exports the current_component internal API (this was risky to use in the first place but yeah here we are...)
Solution Brainstorm
Tried a quick update today but the blocker here is that we also need to upgrade Jest or switch to vitest.
Added this to the v8 milestone. Might be worth to just expose the componentTrackingPreprocessor going forward and remove withSentryConfig again. I have the feeling this is not gonna play well with SvelteKit and I wanna stay away from such a general wrapper.
👋 Svelte maintainer here - if you have any questions regarding how to adapt the SDK to Svelte 5, let me know. Ideally Svelte 5 provides the public APIs you need to achieve what you want.
Reacted by Francesco Gringl-Novy, Frederic Houle, Sreetam Das, Scott and Laestry
Reacted by Lukas Stracke, Tim Jackleus, Sreetam Das, Scott and Laestry
@dummdidumm thanks a lot! Are you planning on exposing a way of getting the component name in onMount callbacks? Previously we relied on the current_component internal API (I know, not smart) which was removed.
For a component mount and update time tracking utility we export from our Svelte SDK. We have some automatism around this (which we'll also rework in our next SDK major version) but this utility used to automatically obtain the component name without users having to specify it in Svelte 3 and 4.
If this is no longer possible in Svelte 5, that's fine, I was just wondering because I'll soon start reworking this feature for Svelte 5 support.
Out of curiosity: how does this work for other frameworks? E.g. how do you obtain that name from React? Do they provide it? Or is there just no way and devs have to do something else there?
@dummdidumm Other frameworks often don't have this API at all and people have to add it manually. React has an API for this but it needs build-time config. We built a feature in our bundler plugins to annotate components: getsentry/sentry-javascript-bundler-plugins#468
I just merged #11807 which auto-closed this issue. We'll make a new beta release for v8 of our SDK on Monday which will ship with support for Svelte 5 (compatible with the latest Svelte 5 preview)!
Reacted by Kern Herskind Nightingale, Peter Batory-Bernardin and Tuni-Soft
I am testing out Svelte 5 and discovered this error message:
Uncaught (in promise) Error: Your application, or one of its dependencies, imported from 'svelte/internal', which was a private module used by Svelte 4 components that no longer exists in Svelte 5. It is not intended to be public API. If you're a library author and you used 'svelte/internal' deliberately, please raise an issue on https://github.com/sveltejs/svelte/issues detailing your use case.
The only package I see importing from svelte/internal is this one. Here is what I think is the relevant line of code:
@happycollision did you try out Svelte 5 with version 8.0.0 RC or beta of the @sentry/svelte SDK? The vite config you linked shouldn't even end up in the SDK package. It's just for local development/testing. Apart from that we don't import from svelte/internal at all so my guess is you're using version 7 (where we did still import from svelte/internal).
If you don't want to upgrade to a preview build, you're in luck: We're releasing 8.0.0 stable today :)
Activity
Lms24 commentedon Jan 24, 2024
Added this to the v8 milestone. Might be worth to just expose the componentTrackingPreprocessor going forward and remove withSentryConfig again. I have the feeling this is not gonna play well with SvelteKit and I wanna stay away from such a general wrapper.
dummdidumm commentedon Feb 28, 2024
👋 Svelte maintainer here - if you have any questions regarding how to adapt the SDK to Svelte 5, let me know. Ideally Svelte 5 provides the public APIs you need to achieve what you want.
Lms24 commentedon Mar 1, 2024
@dummdidumm thanks a lot! Are you planning on exposing a way of getting the component name in
onMountcallbacks? Previously we relied on thecurrent_componentinternal API (I know, not smart) which was removed.dummdidumm commentedon Mar 1, 2024
What do you need the component name for?
Lms24 commentedon Mar 1, 2024
For a component mount and update time tracking utility we export from our Svelte SDK. We have some automatism around this (which we'll also rework in our next SDK major version) but this utility used to automatically obtain the component name without users having to specify it in Svelte 3 and 4.
If this is no longer possible in Svelte 5, that's fine, I was just wondering because I'll soon start reworking this feature for Svelte 5 support.
dummdidumm commentedon Mar 2, 2024
Out of curiosity: how does this work for other frameworks? E.g. how do you obtain that name from React? Do they provide it? Or is there just no way and devs have to do something else there?
lforst commentedon Mar 4, 2024
@dummdidumm Other frameworks often don't have this API at all and people have to add it manually. React has an API for this but it needs build-time config. We built a feature in our bundler plugins to annotate components: getsentry/sentry-javascript-bundler-plugins#468
Lms24 commentedon Apr 26, 2024
I just merged #11807 which auto-closed this issue. We'll make a new beta release for v8 of our SDK on Monday which will ship with support for Svelte 5 (compatible with the latest Svelte 5 preview)!
happycollision commentedon May 13, 2024
I am testing out Svelte 5 and discovered this error message:
The only package I see importing from
svelte/internalis this one. Here is what I think is the relevant line of code:sentry-javascript/packages/svelte/vite.config.ts
Line 13 in bd9ead6
@Lms24, would you like a separate issue opened for this, or do you want to do something else?
Lms24 commentedon May 13, 2024
@happycollision did you try out Svelte 5 with version 8.0.0 RC or beta of the
@sentry/svelteSDK? The vite config you linked shouldn't even end up in the SDK package. It's just for local development/testing. Apart from that we don't import fromsvelte/internalat all so my guess is you're using version 7 (where we did still import fromsvelte/internal).If you don't want to upgrade to a preview build, you're in luck: We're releasing
8.0.0stable today :)happycollision commentedon May 13, 2024
Hah. I guess that’s the deal, then. All I did was check that I was on latest, not beta.
Lms24 commentedon May 13, 2024
Yup, we just released 8.0.0 - would love to hear if things work for you when you get a chance to upgrade :)