You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ref(astro)!: Remove deprecated release/debug conflict workaround from BuildTimeOptionsBase (#23270)
Removes the `DeprecatedRuntimeOptions` catch-all type in `@sentry/astro`
that was blocking `release` and `debug` from being proper build-time
options on `BuildTimeOptionsBase`.
The other deprecated runtime options (`dsn`, `environment`,
`sampleRate`, `tracesSampleRate`, `replaysSessionSampleRate`,
`replaysOnErrorSampleRate`) have no build-time equivalent, so they can
no longer be set via `sentryAstro()` at all. The generated snippet now
falls back to fixed defaults for them. This was already the deprecated,
discouraged path; anyone needing non-default values already needs (and
can continue using) a dedicated `sentry.client.config.ts` /
`sentry.server.config.ts` file with a direct `Sentry.init()` call, which
is unaffected by this change.
Closes#22248
---------
Co-authored-by: Fable 5 <cursoragent@cursor.com>
Runtime SDK options (`dsn`, `environment`, `release` as a string, `sampleRate`, `tracesSampleRate`, `replaysSessionSampleRate`, `replaysOnErrorSampleRate`) can no longer be passed to `sentryAstro()`. Configure them in `sentry.client.config.ts` / `sentry.server.config.ts` instead. `release` and `debug` on `sentryAstro()` are now build-time options (`release` for source map uploads, `debug` for build-time logging). If no config files exist, the generated default init snippets still pick them up (`release.name` as the runtime `release`, `debug` for SDK debug logging). The generated client snippet now always includes the `Replay` integration with default sample rates — to customize or remove it (previously done by setting both replay sample rates to `0`), create a `sentry.client.config.ts`.
985
+
986
+
```ts
987
+
// astro.config.mjs — before
988
+
import { defineConfig } from'astro/config';
989
+
importsentryfrom'@sentry/astro';
990
+
991
+
exportdefaultdefineConfig({
992
+
integrations: [
993
+
sentry({
994
+
// runtime SDK options on the integration
995
+
dsn:'https://example@sentry.io/123',
996
+
release:'1.0.0',
997
+
environment:'production',
998
+
tracesSampleRate:0.5,
999
+
}),
1000
+
],
1001
+
});
1002
+
```
1003
+
1004
+
```ts
1005
+
// astro.config.mjs — after (build-time options only)
1006
+
import { defineConfig } from'astro/config';
1007
+
importsentryfrom'@sentry/astro';
1008
+
1009
+
exportdefaultdefineConfig({
1010
+
integrations: [
1011
+
sentry({
1012
+
org:'my-org',
1013
+
project:'my-project',
1014
+
authToken:process.env.SENTRY_AUTH_TOKEN,
1015
+
release: { name:'1.0.0' },
1016
+
debug:true,
1017
+
}),
1018
+
],
1019
+
});
1020
+
```
1021
+
1022
+
```ts
1023
+
// sentry.client.config.ts — after (runtime SDK options)
1024
+
import*asSentryfrom'@sentry/astro';
1025
+
1026
+
Sentry.init({
1027
+
dsn:'https://example@sentry.io/123',
1028
+
release:'1.0.0',
1029
+
environment:'production',
1030
+
tracesSampleRate:0.5,
1031
+
});
1032
+
```
1033
+
982
1034
### `@sentry/react-router`
983
1035
984
1036
The deprecated `sourceMapsUploadOptions` option was removed from `sentryReactRouter()`. Move its fields to the root level of the `sentryConfig` passed to `sentryReactRouter()`. Note that `enabled` was replaced by `sourcemaps.disable` (inverted: `enabled:false` becomes `sourcemaps: { disable:true }`).
`You passed in additional options (${deprecatedOptionsKeys.join(
59
-
', ',
60
-
)}) to the Sentry integration. This is deprecated and will stop working in a future version. Instead, configure the Sentry SDK in your \`sentry.client.config.(js|ts)\` or \`sentry.server.config.(js|ts)\` files.`,
'You passed in additional options (environment, release, dsn) to the Sentry integration. This is deprecated and will stop working in a future version. Instead, configure the Sentry SDK in your `sentry.client.config.(js|ts)` or `sentry.server.config.(js|ts)` files.',
0 commit comments