-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
SvelteKit integration can't build #10739
Comments
Hi @enyo thanks for writing in! A couple of questions:
|
|
@Lms24 I've isolated the issue, and it's due to rendering on the edge with Vercel.
Now building fails with the above error message. |
export const config = {
runtime: 'edge',
external: ['@sentry/sveltekit'],
}; |
|
Ah... of course this doesn't work. This does the opposite of what I thought it would do, and doesn't include the package at all, so of course this will work in the build, but fail when trying to deploy. |
Hi @enyo thanks for writing in! I'm fairly certain the build error originates because you're using Vercel's edge runtime. Unfortunately, at this time, our SvelteKit SDK is not compatible with Vercel's edge runtime (as stated in our docs). Edge runtime support is being tracked in #9107. We're currently focussing all our efforts on shipping the next major version of the JS SDKs but it's likely that we'll edge support soon afterwards. |
I'm going to close this issue because in essence I believe it's a duplicate of #9107. Please feel free to ping me if you think this should be reopened. |
I see @Lms24 . Is there a way I can disable sentry for edge functions? I just have a few routes that use edge, and I can't use sentry at all because of this issue. |
Hmm this is unfortunately a bit tricky because you somehow need to conditionally decide if the Sentry import and code in This is generally one of the tricky parts to solve for edge support: When do we inject our Node SDK and when the (potential) Edge SDK. I also haven't looked much into the vercel adapter how they actually build stuff for edge vs serverless. What you can try to do (actually, I'd be really interested in the results) is create a vite plugin that loads a dummy file instead of the actual one. But again, you need a way to find out if Sentry should be added or not. That's the challenge you (and we eventually) need to solve. |
This error also happens when deploying to Cloudflare's Pages. For very likely similar reasons |
The same happens for Netlify with the edge option turned on |
The error occurs even if we try to build locally through npm run build. |
please consider reopening this issue as it's not solved |
This most likely depends on the used adapter. I don't think reopening this issue changes anything tbh. We're tracking vercel Edge support in the linked issue and we're aware of this error in cloudflare and other non-Node runtimes (#8291). |
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.101.1
Framework Version
SvelteKit 2.4.3
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
I installed sentry in my SvelteKit app as the docs suggested (with the wizard). I double checked everything with the manual installation guide
Expected Result
It working
Actual Result
Building the SvelteKit project fails:
The text was updated successfully, but these errors were encountered: