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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] add @sentry/svelte import for clarity #8343

Merged
merged 7 commits into from
Jan 5, 2023

Conversation

oekazuma
Copy link
Contributor

@oekazuma oekazuma commented Jan 5, 2023

This addition makes it easier to see that Sentry is providing Svelte SDK.

@changeset-bot
Copy link

changeset-bot bot commented Jan 5, 2023

⚠️ No Changeset found

Latest commit: 5c59387

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
kit 🔄 Building (Inspect) Jan 5, 2023 at 2:46PM (UTC)

@Rich-Harris
Copy link
Member

Thank you! I'm not sure this is the right package to use though — it looks like @sentry/svelte re-exports captureException from @sentry/browser, which I assume we don't want to be using in server hooks. I don't know my way around Sentry well enough to know if that will break, or if there's a server-side equivalent that we should use instead (there's @sentry/node, but presumably that's Node-specific).

Copy link
Contributor

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I'm working on the Sentry JavaScript SDKs. We really appreciate the shout out on the SvelteKit docs and I think it's great that you want to add more detailed instructions how to use Sentry.

Just a couple of notes:

  • As correctly pointed out by @Rich-Harris, @sentry/svelte is only meant for Svelte apps running in the browser (i.e. not the server part of SvelteKit apps). Instead, you can use @sentry/node on the server side.
  • Just calling Sentry.captureException isn't enough, both Sentry SDKs need to be initialized by calling Sentry.init.

Coincidentally, I recently started looking into using Sentry in SvelteKit and posted some primary instructions in our GH discussion about SvelteKit support. We'll eventually create a proper SvelteKit SDK but these instructions can be seen as a starting point what people can already do with currently available Sentry SDKs. Feel free to take a look for more details. Also we always appreciate feedback and input ;)

Lmk if you have additional questions, happy to help!

documentation/docs/30-advanced/20-hooks.md Outdated Show resolved Hide resolved
documentation/docs/30-advanced/20-hooks.md Outdated Show resolved Hide resolved
documentation/docs/30-advanced/25-errors.md Outdated Show resolved Hide resolved
@oekazuma
Copy link
Contributor Author

oekazuma commented Jan 5, 2023

From my research, it seems that Sentry support for SvelteKit is currently under trial.
getsentry/sentry-javascript#5838 (comment)

The server side seems to work on node by using @sentry/node, but not all features seem to work perfectly.

I thought about adding this to the documentation so as not to confuse users when using Sentry with SvelteKit, but I don't know what to do...

@oekazuma
Copy link
Contributor Author

oekazuma commented Jan 5, 2023

@Rich-Harris @Lms24
Thank you!

I've applied the suggested changes!

@Rich-Harris
Copy link
Member

Thank you @Lms24 — just to be sure, will @sentry/node work in non-Node server environments like Cloudflare Workers, Deno, Vercel Edge Functions and so on?

@Lms24
Copy link
Contributor

Lms24 commented Jan 5, 2023

will @sentry/node work in non-Node server environments like Cloudflare Workers, Deno, Vercel Edge Functions and so on?

@Rich-Harris unfortunately not yet. We're working on compatibility with these environments (getsentry/sentry-javascript#5611) but no concrete time frame yet.

@Rich-Harris
Copy link
Member

thanks!

@Rich-Harris Rich-Harris merged commit 52959fe into sveltejs:master Jan 5, 2023
@oekazuma oekazuma deleted the docs-sentry-svelte branch January 5, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants