Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,23 @@ Sentry.init({
The same applies when looking the integration up by name, e.g. via `client.getIntegrationByName('OtlpIntegration')`.
## 6. Type Changes
### `sentrySvelteKit` moved to the `@sentry/sveltekit/vite` subpath export
Affected SDKs: `@sentry/sveltekit`.
The `sentrySvelteKit` Vite plugin is no longer re-exported from the main `@sentry/sveltekit` entry. Import it from `@sentry/sveltekit/vite` in your `vite.config.ts` instead:
```ts
// vite.config.ts

// before
import { sentrySvelteKit } from '@sentry/sveltekit';

// after
import { sentrySvelteKit } from '@sentry/sveltekit/vite';
```
The main entry re-exported the build plugin statically, which pulled the whole build-time module graph (`@sentry/vite-plugin`, and through it `@babel/core`) into the server runtime graph whenever the SDK was imported in server code. Serverless bundlers that trace by reachability (e.g. `@vercel/nft`) then copied all of it into the function. Moving the plugin behind its own subpath keeps it off the runtime entry so it is never reachable from server code.
- Several public types that used `any` now use `unknown` — including `StackFrame`, `SamplingContext`,
`SentryError`, and `User`. You may need to narrow types explicitly where you previously relied on
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sentrySvelteKit } from '@sentry/sveltekit/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sentrySvelteKit } from '@sentry/sveltekit/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sentrySvelteKit } from '@sentry/sveltekit/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sentrySvelteKit } from '@sentry/sveltekit/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sentrySvelteKit } from '@sentry/sveltekit/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import adapter from '@sveltejs/adapter-node';
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sentrySvelteKit } from '@sentry/sveltekit/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { defineConfig } from 'vite';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sentrySvelteKit } from '@sentry/sveltekit/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

Expand Down
5 changes: 5 additions & 0 deletions packages/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
"import": "./build/esm/index.server.js",
"require": "./build/cjs/index.server.js"
}
},
"./vite": {
"types": "./build/types/vite/index.d.ts",
"import": "./build/esm/vite/index.js",
"require": "./build/cjs/vite/index.js"
}
},
"publishConfig": {
Expand Down
1 change: 1 addition & 0 deletions packages/sveltekit/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default makeNPMConfigVariants(
'src/client/svelte5BrowserTracing.ts',
'src/server/index.ts',
'src/worker/index.ts',
'src/vite/index.ts',
],
packageSpecificConfig: {
// Keep the variant subpath external so the transpiled output preserves the import for the
Expand Down
1 change: 0 additions & 1 deletion packages/sveltekit/src/index.server.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './server';
export * from './vite';
1 change: 0 additions & 1 deletion packages/sveltekit/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type * as clientSdk from './client';
import type * as serverSdk from './server';

export * from './client';
export * from './vite';
export * from './server';
export * from './worker';

Expand Down
Loading