-
-
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
Make SvelteKit SDK use Vercel Edge runtime SDK #9107
Comments
Hey again! Is there any way I can contribute to this? |
Hey @isaacharrisholt - for sure. Sorry we gave you a false ok for the last time, we had to figure stuff out technically on our side. Now we are in a better place with the This is a little tricky because we use a multiplexer approach via a webpack plugin in nextjs so that the SDK automatically switches between using the edge or node sdk. @lforst any tips on the SvelteKit SDK? We can probably use a similar strategy to sveltekit adapter auto to decide between using |
Hacking this in is going to be hard. I suggest waiting for official support from our SDK. This is likely gonna happen near- to medium term. |
Don't mean to nag, but what do near and medium term mean to you? We're likely going to have to move away from sentry due to the lack of edge support, but I want to make sure we don't do that if this is right around the corner. |
@knd775 1 month to 3 or so? Sveltekit is one of our smaller SDKs and the intersection of Sveltekit SDK users and Vercel Edge users is even smaller. It does not make sense for us to put this at a higher priority. PRs are always welcome. The building blocks should all be there since we now have the |
thanks for the transparency @lforst, not ideal news but appreciate knowing the rough roadmap |
Just adding a +1 to this as another customer who would like to use sveltekit and edge on vercel. |
Just out of curiosity, is there anything about the edge runtime that makes it incompatible with Node? |
We rely on Node APIs to gather metadata and instrument things node specific standard libraries like Sentry specifically, the vercel edge runtime also has way worse stacktraces. Due to sandboxing and bundling, you'll get an error that looks like below - the equivalent Node.js error will be a lot more detailed.
|
@jstjoe I think Vercel themselves are stepping away from the edge runtime (see tweet by Lee Robinson) so this is less of a priority for us. For now you can use |
Unless you have DB replicas near the users as well, this is not actually how it plays out in real life. |
👍 I do have DB near the users. And a lot of stuff that doesn’t require a
DB roundtrip as well.
…On Thu, Jun 20, 2024 at 11:06 Ben Ayles ***@***.***> wrote:
1. staying on Node.js and sacrificing performance and user experience
for my global users
Unless you have DB replicas near the users as well, this is not actually
how it plays out in real life.
—
Reply to this email directly, view it on GitHub
<#9107 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPMC5BQDPTSAPU5SMOK5P3ZIL4YNAVCNFSM6AAAAAA5GH4UKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBRGA2TMOBWGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@AbhiPrasad they aren't ending support for edge, that tweet was (very confusingly) about how Vercel uses Vercel for their own apps. See this clarification: https://x.com/leeerob/status/1780710814560960759?s=46 ETA: He's just saying it's not universally better, and that it's not the best choice for some apps including the ones that Vercel builds. They've always had a geocentric focus on the east coast userbase though. Regardless if it's Vercel Edge or Cloudflare edge I'd like to use sentry in an edge environment. If Sentry doesn't plan to support that I understand but please clarify so we can stop waiting and move now. |
I apologize if I came across as dismissive, it was not my intention. The reason I brought up the tweet is simply just a matter of prioritization - considering it's the edge runtime is less emphasized at Vercel (only some use cases instead of every server use case) we can prioritize some other tasks like our ongoing work on Sentry SDKs for solid-js and nuxt.
To be clear, we support Vercel Edge: https://www.npmjs.com/package/@sentry/vercel-edge. This issue is basically about if we support automatically detecting and using the vercel edge sdk for SvelteKit apps with 0 config (like we do for nextjs). The workaround for not supporting automatic detect is to add the Vercel Edge SDK yourself to the SvelteKit server entry points which basically is:
You shouldn't have to change anything with sourcemaps uploading or your client config - simply just the server-side stuff. There are two notable limitations that you'll notice with Sentry data that is because of the runtime itself:
Aside: the reason why we don't have a generic |
I've been working on getting Sentry working in my Sveltekit app today that uses both the Vercel This seems to be tricky, because Sveltekit will first merge all the source with all the dependencies, including So far, to get it working I've had to alter the The error I initially see is this one, for reference: #6692 (comment) |
That is valid but I can see that this is very annoying. In theory you could strip Sentry out of your bundles on edge and you could use Other than that I unfortunately don't have any news. @Lms24 may soon be able to update the SDK so that at least you're able to build when running on Edge. |
I've worked on it some more and I have extended the workaround to use
If it were a drop-in replacement, I could have hopefully used Note that to be able to do any of this, I currently have to fork
I think that's effectively what I'm doing now, but if there's a better way to achieve it then that would probably be preferable. I feel like this is actually becoming more of a a sveltekit issue than a sentry issue though to be fair. |
Just like Next.js, make the SvelteKit SDK detect and use the Vercel Edge runtime SDK if need be.
The text was updated successfully, but these errors were encountered: