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
{{ message }}
Repository navigation
Commit ec50b3e
Browse filesBrowse the repository at this point in the historyBrowse files
feat(nuxt)!: Bundle server config into Nitro build (#24094)
Previously, the `sentry.server.config.ts` file was emitted in the build
output so it can be added with `--import`. As we don't rely on
early-importing anymore (thanks to orchestrion), we don't need this file
anymore.
- **Nitro plugin init (default):** The server config is now bundled into
the Nitro build and imported by a generated nitro plugin, so
`Sentry.init` runs at startup without `node --import`. Works on Nitro 2
and 3, prod and dev (hurray)
- **`--import` compat:** The old file path now gets a shim that just
prints "remove this flag". A CI variant runs the whole suite with the
shim preloaded to see if the warning is printed
- **Double init guard:** A preload that really calls `init` wins. The
bundled init skips with a notice.
- **Prerender:** Init is skipped during prerendering, so CI builds send
nothing. Tests assert no trace meta tags in prerendered HTML.
- **Early-crash tests:** Errors thrown before `listen` are captured and
flushed (first and last plugin slot)
- **Deprecated:** both `autoInjectServerSentry` modes, kept working
until v12
Closes#24149
Calls to rate limiter bindings (`env.MY_RATE_LIMITER.limit()`) no longer create a span. The removed span had the op `rpc`, the origin `auto.faas.cloudflare.rate_limit`, and the attribute `rpc.service: cloudflare.rate_limit`. Remove any dashboard, alert, or `ignoreSpans` entry that references it.
1207
1207
1208
+
### `@sentry/nuxt`: the server config is bundled, `--import` is no longer needed
1209
+
1210
+
The SDK now bundles `sentry.server.config.ts` into the Nitro server build, where it initializes itself when the server starts. Instrumentation happens at build time, so preloading the config file is no longer necessary.
1211
+
1212
+
Remove the `--import` flag from your production start command:
Old start commands keep working: the SDK still emits a file at the old path, but it only prints a reminder that the flag can be removed. If you preload a file that calls `Sentry.init` yourself, that init wins and the bundled one is skipped.
1223
+
1224
+
The same applies in development. Remove the `NODE_OPTIONS` preload:
1225
+
1226
+
```bash
1227
+
# before
1228
+
NODE_OPTIONS='--import ./.nuxt/dev/sentry.server.config.mjs' nuxt dev
1229
+
1230
+
# after
1231
+
nuxt dev
1232
+
```
1233
+
1234
+
Since no preload is needed anymore, the `autoInjectServerSentry` option (`'top-level-import'` and `'experimental_dynamic-import'`) and `experimental_entrypointWrappedFunctions` are deprecated. Remove them from your `sentry` module options as the default behavior replaces both. They will be deleted in the next major version.
1235
+
1208
1236
### `@sentry/ember` is now a v2 addon with manual setup
After the rename, the SDK bundles the file into the Nitro server build and initializes itself at server startup. See ["the server config is bundled"](#sentrynuxt-the-server-config-is-bundled---import-is-no-longer-needed) above: the `--import` preload is no longer needed.
1755
1779
1756
1780
The deprecated `sourceMapsUploadOptions` module option was removed. Move its fields to the root level of the `sentry` module options. Note that `url` was renamed to `sentryUrl`, and `enabled` was replaced by `sourcemaps.disable` (inverted: `enabled: false` becomes `sourcemaps: { disable: true }`).
0 commit comments