Skip to content

Commit d75be37

Browse files
Lms24vivianyentran
andauthored
ref(sveltekit): Update SvelteKit SDK compatibility note (#7073)
The SDK is now also compatible with adapter-auto and adapter-vercel Co-authored-by: vivianyentran <[email protected]>
1 parent 5925afe commit d75be37

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
Sentry's SvelteKit SDK enables automatic reporting of errors and performance data.
22

3-
<Note>
3+
## Compatibility
44

55
The minimum supported **SvelteKit version is `1.0.0`**. This SDK works best with **Vite 4.2** and newer.
66
Older Vite versions might not generate source maps correctly.
77

8-
</Note>
9-
108
<Note>
119

12-
The SvelteKit SDK is designed to work with SvelteKit's [Node adapter](https://kit.svelte.dev/docs/adapter-node).
10+
The SvelteKit SDK is designed to work out of the box with the following SvelteKit adapters:
11+
12+
- [Adapter-auto](https://kit.svelte.dev/docs/adapter-auto) - for Vercel; other platforms might work but we don't guarantee compatiblity at this time.
13+
- [Adapter-vercel](https://kit.svelte.dev/docs/adapter-vercel) - only for Node (Lambda) runtimes, not yet Vercel's edge runtime.
14+
- [Adapter-node](https://kit.svelte.dev/docs/adapter-node).
15+
1316
Other adapters may work but aren't currently supported.
1417
We're looking into extending first-class support to [more adapters](https://kit.svelte.dev/docs/adapters) in the future.
1518

19+
The SvelteKit SDK does not yet work with non-node server runtimes, such as Vercel's edge runtime or Cloudflare Workers.
20+
1621
</Note>

src/platforms/javascript/guides/sveltekit/manual-setup.mdx

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,42 @@ export default {
240240
};
241241
```
242242

243-
Using the `sourceMapsUploadOptions` object is useful if the default source maps upload doesn't work out of the box, for instance, if you have a customized build setup or if you're using the SDK with a SvelteKit adapter other than the Node adapter.
243+
Using the `sourceMapsUploadOptions` object is useful if the default source maps upload doesn't work out of the box, for instance, if you have a customized build setup or if you're using the SDK with a SvelteKit adapter other than the [supported adapters](../#compatibility).
244+
245+
### Overriding SvelteKit Adapter detection
246+
247+
By default, `sentrySvelteKit` will try to detect your SvelteKit adapter to configure source maps upload correctly.
248+
If you're not using one of the [supported adapters](../#compatibility) or the wrong one is detected, you can override the adapter detection by passing the `adapter` option to `sentrySvelteKit`:
249+
250+
```javascript {filename:vite.config.js}
251+
import { sveltekit } from "@sveltejs/kit/vite";
252+
import { sentrySvelteKit } from "@sentry/sveltekit";
253+
254+
export default {
255+
plugins: [
256+
sentrySvelteKit({
257+
adapter: "vercel",
258+
}),
259+
sveltekit(),
260+
],
261+
// ... rest of your Vite config
262+
};
263+
```
264+
265+
```typescript {filename:vite.config.ts}
266+
import { sveltekit } from "@sveltejs/kit/vite";
267+
import { sentrySvelteKit } from "@sentry/sveltekit";
268+
269+
export default {
270+
plugins: [
271+
sentrySvelteKit({
272+
adapter: "vercel",
273+
}),
274+
sveltekit(),
275+
],
276+
// ... rest of your Vite config
277+
};
278+
```
244279

245280
### Disable Source Maps Upload
246281

0 commit comments

Comments
 (0)