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
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,17 @@ export type SentryNuxtModuleOptions = {
128
128
*/
129
129
dynamicImportForServerEntry?: boolean;
130
130
131
+
/**
132
+
* The `asyncFunctionReExports` option is only relevant when `dynamicImportForServerEntry: true` (default value).
133
+
*
134
+
* As the server entry file is wrapped with a dynamic `import()`, previous async function exports need to be re-exported.
135
+
* The SDK detects and re-exports those exports (mostly serverless functions). This is why they are re-exported as async functions.
136
+
* In case you have a custom setup and your server exports other async functions, you can override the default array with this option.
137
+
*
138
+
* @default ['default', 'handler', 'server']
139
+
*/
140
+
asyncFunctionReExports?: string[];
141
+
131
142
/**
132
143
* 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.
133
144
* You can use this option to override any options the SDK passes to the Vite (for Nuxt) and Rollup (for Nitro) plugin.
"[Sentry] No functions found for re-export. In case your server needs to export async functions other than `handler` or `server`, consider adding the name(s) to Sentry's build options `sentry.asyncFunctionReExports` in your `nuxt.config.ts`.",
156
+
),
157
+
);
158
+
}
136
159
137
160
// The enclosing `if` already checks for the suffix in `source`, but a check in `resolution.id` is needed as well to prevent multiple attachment of the suffix
// 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)
@@ -162,7 +185,7 @@ function wrapEntryWithDynamicImport(resolvedSentryConfigPath: string): InputPlug
162
185
`import(${JSON.stringify(entryId)});\n`+
163
186
// 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