Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definitive guide to Sourcemaps and more with Sveltekit 馃帀 #43301

Closed
alexbjorlig opened this issue Jan 16, 2023 · 8 comments
Closed

Definitive guide to Sourcemaps and more with Sveltekit 馃帀 #43301

alexbjorlig opened this issue Jan 16, 2023 · 8 comments

Comments

@alexbjorlig
Copy link

Problem Statement

SvelteKit is awesome - and it's now version 1 (fresh out of beta)!

One of the great things about SvelteKit is the ability to abstract away the hosting provider. You write the same code, and then you can use an adapter to deploy where you want. It could be

  • Node.js platforms like Heroku
  • Cloudflare edge functions
  • Vercel
  • Netlify

The good question now is: How do we get source maps to Sentry?
And follow-ups like:

  • Should you setup both @sentry/browser @sentry/node?
  • Is it wise to use both server/client error hooks?
  • Where do you hook into the Sveltekit life-cycle to enrich the sentry scope on the server?
  • What breadcrumbs do you recommend removing from the default setup?

It would be such a cool thing to solve 鉂わ笍 (Sveltekit actually mentions Sentry already in certain places in the docs).

Solution Brainstorm

I guess the first path to a more robust solution, would be documentation about how sourcemaps can be synced for the different adapters (if there is any change at all???)

Ultimately an integration with the Sentry CLI would be 馃シ

Let me know what you think? - How do you sync source maps from a Sveltekit project?

Our team has not done it yet 馃

@getsantry
Copy link
Contributor

getsantry bot commented Jan 16, 2023

Assigning to @getsentry/support for routing, due by Wed Jan 18 2023 01:00:00 GMT+0000. 鈴诧笍

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Jan 16, 2023

Hey @alexbjorlig great to see you excited around this! We're working on improving our support here by building a first class SDK for just SvelteKit (where everything should just work out of the box!): getsentry/sentry-javascript#6692

See some of our experimental work here: getsentry/sentry-javascript#5838 (comment)

I know @Lms24 has been looking at sourcemaps, perhaps he can help give some more insight here?

@getsantry
Copy link
Contributor

getsantry bot commented Jan 16, 2023

Routing to @getsentry/team-web-sdk-frontend for triage, due by Thu Jan 19 2023 01:00:00 GMT+0000. 鈴诧笍

@AbhiPrasad
Copy link
Member

@alexbjorlig we do have a Vite Plugin, that should upload sourcemaps out of the box. Perhaps this can help get you started? https://docs.sentry.io/platforms/javascript/guides/svelte/sourcemaps/uploading/vite/

@alexbjorlig
Copy link
Author

alexbjorlig commented Jan 16, 2023

Hi @AbhiPrasad - that could be a possible solution.

But how do I know what the folder should be here? Does this not depend on the adapter?

// Specify the directory containing build artifacts
include: "./dist",

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Jan 16, 2023

From the SvelteKit docs, it seems to default to .svelte-kit? https://kit.svelte.dev/docs/configuration#outdir answer below seems to cover it!

@Lms24
Copy link
Member

Lms24 commented Jan 16, 2023

Hi @alexbjorlig thanks for opening this issue. As already mentioned by @AbhiPrasad, I took a look at source maps. There's probably room for improvement but I added a small section to our GH discussion with some preliminary instructions: getsentry/sentry-javascript#5838 (reply in thread)

@AbhiPrasad
Copy link
Member

Hey @alexbjorlig we decided we're going to use getsentry/sentry-javascript#6692 to track our work, so closing this issue as a result. Please open issues in the JavaScript SDK repo if you have any more questions/concerns! Thanks again for reaching out.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants