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
Copy file name to clipboardExpand all lines: packages/nuxt/src/common/types.ts
+23-10
Original file line number
Diff line number
Diff line change
@@ -103,22 +103,35 @@ export type SentryNuxtModuleOptions = {
103
103
debug?: boolean;
104
104
105
105
/**
106
-
* Wraps the server entry file with a dynamic `import()`. This will make it possible to preload Sentry and register
107
-
* necessary hooks before other code runs. (Node docs: https://nodejs.org/api/module.html#enabling)
108
106
*
109
-
* If this option is `false`, the Sentry SDK won't wrap the server entry file with `import()`. Not wrapping the
110
-
* server entry file will disable Sentry on the server-side. When you set this option to `false`, make sure
111
-
* to add the Sentry server config with the node `--import` CLI flag to enable Sentry on the server-side.
107
+
* Enables (partial) server tracing by automatically injecting Sentry for environments where modifying the node option `--import` is not possible.
112
108
*
113
-
* **DO NOT** add the node CLI flag `--import` in your node start script, when `dynamicImportForServerEntry` is set to `true` (default).
109
+
* **DO NOT** add the node CLI flag `--import` in your node start script, when auto-injecting Sentry.
114
110
* This would initialize Sentry twice on the server-side and this leads to unexpected issues.
115
111
*
116
-
* @default true
112
+
* ---
113
+
*
114
+
* **"top-level-import"**
115
+
*
116
+
* Enabling basic server tracing with top-level import can be used for environments where modifying the node option `--import` is not possible.
117
+
* However, enabling this option only supports limited tracing instrumentation. Only http traces will be collected (but no database-specific traces etc.).
118
+
*
119
+
* If `"top-level-import"` is enabled, the Sentry SDK will import the Sentry server config at the top of the server entry file to load the SDK on the server.
120
+
*
121
+
* ---
122
+
* **"experimental_dynamic-import"**
123
+
*
124
+
* Wraps the server entry file with a dynamic `import()`. This will make it possible to preload Sentry and register
125
+
* necessary hooks before other code runs. (Node docs: https://nodejs.org/api/module.html#enabling)
126
+
*
127
+
* If `"experimental_dynamic-import"` is enabled, the Sentry SDK wraps the server entry file with `import()`.
* Options to be passed directly to the Sentry Rollup Plugin (`@sentry/rollup-plugin`) and Sentry Vite Plugin (`@sentry/vite-plugin`) that ship with the Sentry Nuxt SDK.
'[Sentry] Your application is running in development mode. Note: @sentry/nuxt is in beta and may not work as expected on the server-side (Nitro). Errors are reported, but tracing does not work.',
87
+
'[Sentry] Your application is running in development mode. Note: @sentry/nuxt does not work as expected on the server-side (Nitro). Errors are reported, but tracing does not work.',
// In order to correctly import the server config file
122
165
// and dynamically import the nitro runtime, we need to
123
166
// mark the resolutionId with '\0raw' to fall into the
@@ -156,7 +199,11 @@ function wrapEntryWithDynamicImport({
156
199
// Concatenates the query params to mark the file (also attaches names of re-exports - this is needed for serverless functions to re-export the handler)
@@ -113,7 +122,7 @@ export function constructWrappedFunctionExportQuery(
113
122
consoleSandbox(()=>
114
123
// eslint-disable-next-line no-console
115
124
console.warn(
116
-
"[Sentry] No functions found to wrap. In case the server needs to export async functions other than `handler` or `server`, consider adding the name(s) to Sentry's build options `sentry.entrypointWrappedFunctions` in `nuxt.config.ts`.",
125
+
"[Sentry] No functions found to wrap. In case the server needs to export async functions other than `handler` or `server`, consider adding the name(s) to Sentry's build options `sentry.experimental_entrypointWrappedFunctions` in `nuxt.config.ts`.",
0 commit comments