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
+8-5
Original file line number
Diff line number
Diff line change
@@ -103,16 +103,19 @@ 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
107
-
* server entry file will disable Sentry on the server-side. When you set this option to `true`, make sure
108
-
* to add the sentry server config with the node `--import` CLI flag to enable Sentry on the server-side.
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.
109
112
*
110
-
* **DO NOT** add the node CLI flag `--import` in your node start script, when `disableDynamicImportWrapping` is set to `false`.
113
+
* **DO NOT** add the node CLI flag `--import` in your node start script, when `dynamicImportWrapping` is set to `true` (default).
111
114
* This would initialize Sentry twice on the server-side and this leads to unexpected issues.
112
115
*
113
-
* @defaultfalse
116
+
* @defaulttrue
114
117
*/
115
-
disableDynamicImportWrapping?: boolean;
118
+
dynamicImportWrapping?: boolean;
116
119
117
120
/**
118
121
* 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.
Copy file name to clipboardExpand all lines: packages/nuxt/src/vite/addServerConfig.ts
+3-6
Original file line number
Diff line number
Diff line change
@@ -139,11 +139,8 @@ function wrapEntryWithDynamicImport(resolvedSentryConfigPath: string): InputPlug
139
139
: resolution.id
140
140
// 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)
@@ -163,7 +160,7 @@ function wrapEntryWithDynamicImport(resolvedSentryConfigPath: string): InputPlug
163
160
// `import()` can be used for any code that should be run after the hooks are registered (https://nodejs.org/api/module.html#enabling)
164
161
`import(${JSON.stringify(entryId)});\n`+
165
162
// By importing "import-in-the-middle/hook.mjs", we can make sure this file wil be included, as not all node builders are including files imported with `module.register()`.
0 commit comments