diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3cf42845dbbf..6f6fe751c3aa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,50 @@
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
+- **feat(solidstart): Default to `--import` setup and add `autoInjectServerSentry` ([#14862](https://github.com/getsentry/sentry-javascript/pull/14862))**
+
+To enable the SolidStart SDK, wrap your SolidStart Config with `withSentry`. The `sentrySolidStartVite` plugin is now automatically
+added by `withSentry` and you can pass the Sentry build-time options like this:
+
+```js
+import { defineConfig } from '@solidjs/start/config';
+import { withSentry } from '@sentry/solidstart';
+
+export default defineConfig(
+ withSentry(
+ {
+ /* Your SolidStart config options... */
+ },
+ {
+ // Options for setting up source maps
+ org: process.env.SENTRY_ORG,
+ project: process.env.SENTRY_PROJECT,
+ authToken: process.env.SENTRY_AUTH_TOKEN,
+ },
+ ),
+);
+```
+
+With the `withSentry` wrapper, the Sentry server config should not be added to the `public` directory anymore.
+Add the Sentry server config in `src/instrument.server.ts`. Then, the server config will be placed inside the server build output as `instrument.server.mjs`.
+
+Now, there are two options to set up the SDK:
+
+1. **(recommended)** Provide an `--import` CLI flag to the start command like this (path depends on your server setup):
+ `node --import ./.output/server/instrument.server.mjs .output/server/index.mjs`
+2. Add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry (comes with tracing limitations)
+ ```js
+ withSentry(
+ {
+ /* Your SolidStart config options... */
+ },
+ {
+ // Optional: Install Sentry with a top-level import
+ autoInjectServerSentry: 'top-level-import',
+ },
+ );
+ ```
+
## 8.51.0
### Important Changes
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/.gitignore b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/.gitignore
new file mode 100644
index 000000000000..a51ed3c20c8d
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/.gitignore
@@ -0,0 +1,46 @@
+
+dist
+.solid
+.output
+.vercel
+.netlify
+.vinxi
+
+# Environment
+.env
+.env*.local
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# IDEs and editors
+/.idea
+.project
+.classpath
+*.launch
+.settings/
+
+# Temp
+gitignore
+
+# testing
+/coverage
+
+# misc
+.DS_Store
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+/test-results/
+/playwright-report/
+/playwright/.cache/
+
+!*.d.ts
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/.npmrc b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/.npmrc
new file mode 100644
index 000000000000..070f80f05092
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/.npmrc
@@ -0,0 +1,2 @@
+@sentry:registry=http://127.0.0.1:4873
+@sentry-internal:registry=http://127.0.0.1:4873
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/README.md b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/README.md
new file mode 100644
index 000000000000..9a141e9c2f0d
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/README.md
@@ -0,0 +1,45 @@
+# SolidStart
+
+Everything you need to build a Solid project, powered by [`solid-start`](https://start.solidjs.com);
+
+## Creating a project
+
+```bash
+# create a new project in the current directory
+npm init solid@latest
+
+# create a new project in my-app
+npm init solid@latest my-app
+```
+
+## Developing
+
+Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a
+development server:
+
+```bash
+npm run dev
+
+# or start the server and open the app in a new browser tab
+npm run dev -- --open
+```
+
+## Building
+
+Solid apps are built with _presets_, which optimise your project for deployment to different environments.
+
+By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add
+it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
+
+## Testing
+
+Tests are written with `vitest`, `@solidjs/testing-library` and `@testing-library/jest-dom` to extend expect with some
+helpful custom matchers.
+
+To run them, simply start:
+
+```sh
+npm test
+```
+
+## This project was created with the [Solid CLI](https://solid-cli.netlify.app)
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
new file mode 100644
index 000000000000..f41b1cb186ef
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/app.config.ts
@@ -0,0 +1,11 @@
+import { withSentry } from '@sentry/solidstart';
+import { defineConfig } from '@solidjs/start/config';
+
+export default defineConfig(
+ withSentry(
+ {},
+ {
+ autoInjectServerSentry: 'experimental_dynamic-import',
+ },
+ ),
+);
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/package.json b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/package.json
new file mode 100644
index 000000000000..62393e038dce
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "solidstart-dynamic-import-e2e-testapp",
+ "version": "0.0.0",
+ "scripts": {
+ "clean": "pnpx rimraf node_modules pnpm-lock.yaml .vinxi .output",
+ "dev": "vinxi dev",
+ "build": "vinxi build && sh ./post_build.sh",
+ "preview": "HOST=localhost PORT=3030 vinxi start",
+ "test:prod": "TEST_ENV=production playwright test",
+ "test:build": "pnpm install && pnpm build",
+ "test:assert": "pnpm test:prod"
+ },
+ "type": "module",
+ "dependencies": {
+ "@sentry/solidstart": "latest || *"
+ },
+ "devDependencies": {
+ "@playwright/test": "^1.44.1",
+ "@solidjs/meta": "^0.29.4",
+ "@solidjs/router": "^0.13.4",
+ "@solidjs/start": "^1.0.2",
+ "@solidjs/testing-library": "^0.8.7",
+ "@testing-library/jest-dom": "^6.4.2",
+ "@testing-library/user-event": "^14.5.2",
+ "@vitest/ui": "^1.5.0",
+ "jsdom": "^24.0.0",
+ "solid-js": "1.8.17",
+ "typescript": "^5.4.5",
+ "vinxi": "^0.4.0",
+ "vite": "^5.4.10",
+ "vite-plugin-solid": "^2.10.2",
+ "vitest": "^1.5.0"
+ },
+ "overrides": {
+ "@vercel/nft": "0.27.4"
+ }
+}
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/playwright.config.mjs b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/playwright.config.mjs
new file mode 100644
index 000000000000..395acfc282f9
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/playwright.config.mjs
@@ -0,0 +1,8 @@
+import { getPlaywrightConfig } from '@sentry-internal/test-utils';
+
+const config = getPlaywrightConfig({
+ startCommand: 'pnpm preview',
+ port: 3030,
+});
+
+export default config;
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/post_build.sh b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/post_build.sh
new file mode 100644
index 000000000000..6ed67c9afb8a
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/post_build.sh
@@ -0,0 +1,8 @@
+# TODO: Investigate the need for this script periodically and remove once these modules are correctly resolved.
+
+# This script copies `import-in-the-middle` and `@sentry/solidstart` from the E2E test project root `node_modules`
+# to the nitro server build output `node_modules` as these are not properly resolved in our yarn workspace/pnpm
+# e2e structure. Some files like `hook.mjs` and `@sentry/solidstart/solidrouter.server.js` are missing. This is
+# not reproducible in an external project (when pinning `@vercel/nft` to `v0.27.0` and higher).
+cp -r node_modules/.pnpm/import-in-the-middle@1.*/node_modules/import-in-the-middle .output/server/node_modules
+cp -rL node_modules/@sentry/solidstart .output/server/node_modules/@sentry
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/public/favicon.ico b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/public/favicon.ico
new file mode 100644
index 000000000000..fb282da0719e
Binary files /dev/null and b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/public/favicon.ico differ
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/app.tsx b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/app.tsx
new file mode 100644
index 000000000000..3eb85218b575
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/app.tsx
@@ -0,0 +1,22 @@
+import { withSentryRouterRouting } from '@sentry/solidstart/solidrouter';
+import { MetaProvider, Title } from '@solidjs/meta';
+import { Router } from '@solidjs/router';
+import { FileRoutes } from '@solidjs/start/router';
+import { Suspense } from 'solid-js';
+
+const SentryRouter = withSentryRouterRouting(Router);
+
+export default function App() {
+ return (
+ (
+
+ SolidStart - with Vitest
+ {props.children}
+
+ )}
+ >
+
+
+ );
+}
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/entry-client.tsx b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/entry-client.tsx
new file mode 100644
index 000000000000..11087fbb5918
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/entry-client.tsx
@@ -0,0 +1,18 @@
+// @refresh reload
+import * as Sentry from '@sentry/solidstart';
+import { solidRouterBrowserTracingIntegration } from '@sentry/solidstart/solidrouter';
+import { StartClient, mount } from '@solidjs/start/client';
+
+Sentry.init({
+ // We can't use env variables here, seems like they are stripped
+ // out in production builds.
+ dsn: 'https://public@dsn.ingest.sentry.io/1337',
+ environment: 'qa', // dynamic sampling bias to keep transactions
+ integrations: [solidRouterBrowserTracingIntegration()],
+ tunnel: 'http://localhost:3031/', // proxy server
+ // Performance Monitoring
+ tracesSampleRate: 1.0, // Capture 100% of the transactions
+ debug: !!import.meta.env.DEBUG,
+});
+
+mount(() => , document.getElementById('app')!);
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/entry-server.tsx b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/entry-server.tsx
new file mode 100644
index 000000000000..276935366318
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/entry-server.tsx
@@ -0,0 +1,21 @@
+// @refresh reload
+import { StartServer, createHandler } from '@solidjs/start/server';
+
+export default createHandler(() => (
+ (
+
+
+
+
+
+ {assets}
+
+
+
{children}
+ {scripts}
+
+
+ )}
+ />
+));
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/instrument.server.ts b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/instrument.server.ts
new file mode 100644
index 000000000000..3dd5d8933b7b
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/instrument.server.ts
@@ -0,0 +1,9 @@
+import * as Sentry from '@sentry/solidstart';
+
+Sentry.init({
+ dsn: process.env.E2E_TEST_DSN,
+ environment: 'qa', // dynamic sampling bias to keep transactions
+ tracesSampleRate: 1.0, // Capture 100% of the transactions
+ tunnel: 'http://localhost:3031/', // proxy server
+ debug: !!process.env.DEBUG,
+});
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/routes/back-navigation.tsx b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/routes/back-navigation.tsx
new file mode 100644
index 000000000000..ddd970944bf3
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/routes/back-navigation.tsx
@@ -0,0 +1,9 @@
+import { A } from '@solidjs/router';
+
+export default function BackNavigation() {
+ return (
+
+ User 6
+
+ );
+}
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/routes/client-error.tsx b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/routes/client-error.tsx
new file mode 100644
index 000000000000..5e405e8c4e40
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/routes/client-error.tsx
@@ -0,0 +1,15 @@
+export default function ClientErrorPage() {
+ return (
+
+
+
+ );
+}
diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/routes/error-boundary.tsx b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/routes/error-boundary.tsx
new file mode 100644
index 000000000000..b22607667e7e
--- /dev/null
+++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/src/routes/error-boundary.tsx
@@ -0,0 +1,64 @@
+import * as Sentry from '@sentry/solidstart';
+import type { ParentProps } from 'solid-js';
+import { ErrorBoundary, createSignal, onMount } from 'solid-js';
+
+const SentryErrorBoundary = Sentry.withSentryErrorBoundary(ErrorBoundary);
+
+const [count, setCount] = createSignal(1);
+const [caughtError, setCaughtError] = createSignal(false);
+
+export default function ErrorBoundaryTestPage() {
+ return (
+
+ {caughtError() && (
+
+ )}
+
+