-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
error no matching export current_component - svelte 5 and sveltekit ^2.0 #10275
Comments
Hi @JonathonRP I believe this issue is related to our component tracking feature not working well with SvelteKit 2 / Svelte 5. It's something we need to look into but I believe the root cause is ultimately the same as in #10276 Can you confirm that your setup is identical in both issues? Or did you change something to get around one of the two errors you reported? |
@Lms24 setup for this is without disabling tracking withSentryConfig. As component tracking is on by default which I was attempting to work around by disabling but found that had errors no matter the route I took. I tried both svelte browser version and sveltekit version. |
I came across this when starting a new project using '@sentry/svelte', '@sentry_integration' while using ^7.95.0, with @sveltejs/kit version ^2.4.3 along with vite "^5.0.3".
And in the browser I would get 504 Outdated Optimize Dep) on @sentry_integration and @sentry/svelte. Workaround would be to exclude these in vite.config.ts
|
Hi @socketopp are you also using Svelte 5? I was under the impression that I'm wondering where you're getting |
Yes I am using
Sorry typo from my end. When I don't exclude it in the optimizeDeps, I receive these errors in Network tab and the page continuously load.
|
I investigated this a bit today but there's an important piece of information missing: Svelte 5 is not yet supported by our SDK. This is on purpose because we can't guarantee support for a framework version that's not stable yet. However, if you don't use Ideally, we find a way to unblock Svelte 5 users without changing too much but I tried doing so in #10311 and #10312 but turns out, changing the package.json properties will make our tests unusable because our jest version is too old 🥲 So this needs more work and I'm currently super busy with ~10 other tasks. I'll write this up in a proper issue for now but can't give you an ETA. Again, we do not support Svelte 5 until it becomes stable. So all the work I'm doing here would be merely preparation for this for you to use at your own risk. |
@Lms24 one idea if this is caused by performance instrumentation, is there a way to disable performance instrumentation? |
This is not caused by performance instrumentation. It's caused by Vite pre-bundling the SDK and trying to resolve the @socketopp mentioned a workaround but for me this locally produced some other errors. Might be worth giving this a try but no guarantees, sorry. |
Thanks, I'll try. Yeah internal isn't a stable API to relay on according to sveltekit team. To me it seems like a fall back that if you just didn't import components would have to be supplied manually which I think should be fine and expected behavior, but might be a minor breaking change |
optimizeDeps: {
exclude: ['@sentry/sveltekit']
}, this gets rid of the error, but for me sveltekit app is still not interactive which is my blocker and reason I cared about error, my app |
I reverted back to SvelteKit 1.x since SvelteKit 2.x used Vite/Svelte 5. I totally agree with not supporting 5 since it's clearly not completely stable. |
Just to make sure: Our SvelteKit SDK should support SvelteKit 2 with Vite 5 and Svelte 4. As far as I can tell from this investigation, only the addition of Svelte 5 will cause issues. If you reverted for other reason, no worries :) I just wanna make sure it's not us causing problems that aren't on our radar yet. |
Sveltekit 2 only uses vite 5, I installed svelte 5. And yes I don't mind the not supporting svelte 5 |
@Lms24 is the other issues after removing that line specifically the library testing with jest? |
All the items tracked in #10318 need to be done for Svelte 5 support as far as we can tell right now. Feel free to give upgrading to vitest a try if you want. Happy to review the PR. We're already using Vitest in our Astro and SvelteKit packages, so ideally, we use it similarly here. I think though, considering removing the |
Disabling performance monitoring for now, see getsentry/sentry-javascript#10275
Disabling performance monitoring for now, see getsentry/sentry-javascript#10275
I'm working around this for now by turning off performance monitoring (though it probably kinda works but the names of all the components are probably lost), and patching
Looking forward to proper support 🙂 |
@Lms24 has this been merged or released yet? |
@JonathonRP The SDK does not yet support svelte 5. Progress is tracked here #10318. |
Hey everyone, 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)! Thanks for your patience and special shout out to @JonathonRP for setting the ground stone by porting our Svelte SDK tests from Jest to Vitest (#10350)! |
Is this still releasing today? |
Actually for some reason pnpm installed latest and not next tag version |
@Lms24 I'm using spotlight and getting error that a is not a function... that's seems to come from using spotlight and sentry, it's inside Browserclient.addIntegration, setupIntegration, gw.setupOnce I could also make another issue for this, if you like? |
@JonathonRP Yes please open another issue with reproduction steps. Thank you! |
@JonathonRP sorry for the late response; I'm currently out sick and just saw this. Before you open another issue, please try upgrading to the Spotlight 2.x alpha. Since you're using v8 of the Svelte(kit) SDK, Spotlight needs to be update to its new major as well. More information here: https://github.com/getsentry/spotlight/releases/tag/%40spotlightjs%2Fspotlight%402.0.0-alpha.1 |
I'll give that a try, thanks! |
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
latest
Framework Version
svelte 5, sveltekit 2
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
svelte version ^5 and sveltekit ^2
install by guide, run dev.
Expected Result
no error message
Actual Result
error message - `No matching export in 'svelte' for import 'current_component'
The text was updated successfully, but these errors were encountered: