From e79969420b74631469eda36c392feef59f1665a1 Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 23 Oct 2026 14:01:31 -0700 Subject: [PATCH] feat(solidstart): Export `withSentry` from `@sentry/solidstart/vite` `withSentry` wraps the SolidStart config at build time. The root entry re-exports it, so the server runtime entry reaches `@sentry/bundler-plugins` and the orchestrion rollup transform. Any tool that traces or bundles the server entry then pulls that tooling in. `withSentry` now also comes from `@sentry/solidstart/vite`, next to the Vite plugin. The root export stays, deprecated, until the next major version, so existing `app.config.ts` files keep working. The E2E apps use the new path. Refs #25676 Co-Authored-By: Claude Opus 5.5 (1M context) --- .../solidstart-dynamic-import/app.config.ts | 2 +- .../test-applications/solidstart-spa/app.config.ts | 2 +- .../test-applications/solidstart-static/app.config.ts | 2 +- .../solidstart-top-level-import/app.config.ts | 2 +- .../e2e-tests/test-applications/solidstart/app.config.ts | 2 +- packages/solidstart/src/index.server.ts | 9 ++++++++- packages/solidstart/src/index.types.ts | 8 +++++++- packages/solidstart/src/vite/index.ts | 1 + 8 files changed, 21 insertions(+), 7 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/app.config.ts b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/app.config.ts index f41b1cb186ef..9835b34f5592 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/app.config.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/app.config.ts @@ -1,4 +1,4 @@ -import { withSentry } from '@sentry/solidstart'; +import { withSentry } from '@sentry/solidstart/vite'; import { defineConfig } from '@solidjs/start/config'; export default defineConfig( diff --git a/dev-packages/e2e-tests/test-applications/solidstart-spa/app.config.ts b/dev-packages/e2e-tests/test-applications/solidstart-spa/app.config.ts index 103ecb09a469..447d859e9d34 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart-spa/app.config.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart-spa/app.config.ts @@ -1,4 +1,4 @@ -import { withSentry } from '@sentry/solidstart'; +import { withSentry } from '@sentry/solidstart/vite'; import { defineConfig } from '@solidjs/start/config'; export default defineConfig( diff --git a/dev-packages/e2e-tests/test-applications/solidstart-static/app.config.ts b/dev-packages/e2e-tests/test-applications/solidstart-static/app.config.ts index 71061cf25d96..f3d634978c16 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart-static/app.config.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart-static/app.config.ts @@ -1,4 +1,4 @@ -import { withSentry } from '@sentry/solidstart'; +import { withSentry } from '@sentry/solidstart/vite'; import { defineConfig } from '@solidjs/start/config'; export default defineConfig( diff --git a/dev-packages/e2e-tests/test-applications/solidstart-top-level-import/app.config.ts b/dev-packages/e2e-tests/test-applications/solidstart-top-level-import/app.config.ts index e4e73e9fc570..f8211b6f0b52 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart-top-level-import/app.config.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart-top-level-import/app.config.ts @@ -1,4 +1,4 @@ -import { withSentry } from '@sentry/solidstart'; +import { withSentry } from '@sentry/solidstart/vite'; import { defineConfig } from '@solidjs/start/config'; export default defineConfig( diff --git a/dev-packages/e2e-tests/test-applications/solidstart/app.config.ts b/dev-packages/e2e-tests/test-applications/solidstart/app.config.ts index 71061cf25d96..f3d634978c16 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart/app.config.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart/app.config.ts @@ -1,4 +1,4 @@ -import { withSentry } from '@sentry/solidstart'; +import { withSentry } from '@sentry/solidstart/vite'; import { defineConfig } from '@solidjs/start/config'; export default defineConfig( diff --git a/packages/solidstart/src/index.server.ts b/packages/solidstart/src/index.server.ts index 82b6fe6cbff4..f0ef7dbb60d6 100644 --- a/packages/solidstart/src/index.server.ts +++ b/packages/solidstart/src/index.server.ts @@ -1,2 +1,9 @@ +import { withSentry as _withSentry } from './config'; + export * from './server'; -export * from './config'; + +/** + * @deprecated Import `withSentry` from `@sentry/solidstart/vite` instead. + * This export will be removed in the next major version. + */ +export const withSentry = _withSentry; diff --git a/packages/solidstart/src/index.types.ts b/packages/solidstart/src/index.types.ts index 3ff25e7fa679..b7e71168b171 100644 --- a/packages/solidstart/src/index.types.ts +++ b/packages/solidstart/src/index.types.ts @@ -7,11 +7,17 @@ // exports in this file - which we do below. import type { Client, Integration, Options, StackParser } from '@sentry/core'; import type * as clientSdk from './client'; +import type * as configSdk from './config'; import type * as serverSdk from './server'; export * from './client'; export * from './server'; -export * from './config'; + +/** + * @deprecated Import `withSentry` from `@sentry/solidstart/vite` instead. + * This export will be removed in the next major version. + */ +export declare const withSentry: typeof configSdk.withSentry; /** Initializes Sentry Solid Start SDK */ export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions): Client | undefined; diff --git a/packages/solidstart/src/vite/index.ts b/packages/solidstart/src/vite/index.ts index b23359c06ba5..2289ae888f98 100644 --- a/packages/solidstart/src/vite/index.ts +++ b/packages/solidstart/src/vite/index.ts @@ -1,2 +1,3 @@ export { sentrySolidStart } from './sentrySolidStart'; export type { SentrySolidStartOptions } from './sentrySolidStart'; +export { withSentry } from '../config/withSentry';