|
12 | 12 |
|
13 | 13 | Work in this release was contributed by @aloisklink, @arturovt, @benjick and @maximepvrt. Thank you for your contributions!
|
14 | 14 |
|
| 15 | +- **feat(solidstart)!: Default to `--import` setup and add `autoInjectServerSentry` ([#14862](https://github.com/getsentry/sentry-javascript/pull/14862))** |
| 16 | + |
| 17 | +To enable the SolidStart SDK, wrap your Solid Config with `withSentry`. The `sentrySolidStartVite` plugin is now automatically |
| 18 | +added by `withSentry` and you can pass the Sentry build-time options like this: |
| 19 | + |
| 20 | +```js |
| 21 | +import { defineConfig } from '@solidjs/start/config'; |
| 22 | +import { withSentry } from '@sentry/solidstart'; |
| 23 | + |
| 24 | +export default defineConfig( |
| 25 | + withSentry( |
| 26 | + { |
| 27 | + /* Your Solid config options... */ |
| 28 | + }, |
| 29 | + { |
| 30 | + // Options for setting up source maps |
| 31 | + org: process.env.SENTRY_ORG, |
| 32 | + project: process.env.SENTRY_PROJECT, |
| 33 | + authToken: process.env.SENTRY_AUTH_TOKEN, |
| 34 | + |
| 35 | + // Optional: Install Sentry with a top-level import |
| 36 | + autoInjectServerSentry: 'top-level-import', |
| 37 | + }, |
| 38 | + ), |
| 39 | +); |
| 40 | +``` |
| 41 | + |
| 42 | +With the `withSentry` wrapper, the Sentry server config should not be added to the `public` directory anymore. |
| 43 | +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`. |
| 44 | + |
| 45 | +Now, there are two options to set up the SDK: |
| 46 | + |
| 47 | +1. (recommended) Provide an `--import` CLI flag to the start command like this (path depends on your server setup): |
| 48 | + `node --import ./.output/server/instrument.server.mjs .output/server/index.mjs` |
| 49 | +2. Add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry (comes with tracing limitations) |
| 50 | + |
15 | 51 | ## 8.45.0
|
16 | 52 |
|
17 | 53 | - feat(core): Add `handled` option to `captureConsoleIntegration` ([#14664](https://github.com/getsentry/sentry-javascript/pull/14664))
|
|
0 commit comments