@sentry/nuxt 11.0.0-beta.0 → 11.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/build/cjs/common/devMode.js +16 -0
  2. package/build/cjs/common/devMode.js.map +1 -1
  3. package/build/cjs/module.js +32 -48
  4. package/build/cjs/module.js.map +1 -1
  5. package/build/cjs/server/sdk.js +15 -0
  6. package/build/cjs/server/sdk.js.map +1 -1
  7. package/build/cjs/vite/addServerConfig.js +106 -37
  8. package/build/cjs/vite/addServerConfig.js.map +1 -1
  9. package/build/cjs/vite/middlewareConfig.js +7 -6
  10. package/build/cjs/vite/middlewareConfig.js.map +1 -1
  11. package/build/cjs/vite/orchestrion.js +2 -1
  12. package/build/cjs/vite/orchestrion.js.map +1 -1
  13. package/build/cjs/vite/utils.js +34 -9
  14. package/build/cjs/vite/utils.js.map +1 -1
  15. package/build/esm/common/devMode.js +12 -1
  16. package/build/esm/common/devMode.js.map +1 -1
  17. package/build/esm/module.js +34 -50
  18. package/build/esm/module.js.map +1 -1
  19. package/build/esm/package.json +1 -1
  20. package/build/esm/server/sdk.js +17 -2
  21. package/build/esm/server/sdk.js.map +1 -1
  22. package/build/esm/vite/addServerConfig.js +108 -40
  23. package/build/esm/vite/addServerConfig.js.map +1 -1
  24. package/build/esm/vite/middlewareConfig.js +7 -6
  25. package/build/esm/vite/middlewareConfig.js.map +1 -1
  26. package/build/esm/vite/orchestrion.js +2 -1
  27. package/build/esm/vite/orchestrion.js.map +1 -1
  28. package/build/esm/vite/utils.js +33 -9
  29. package/build/esm/vite/utils.js.map +1 -1
  30. package/build/module/common/devMode.d.ts +12 -2
  31. package/build/module/common/types.d.ts +7 -0
  32. package/build/module/module.json +1 -1
  33. package/build/module/module.mjs +177 -99
  34. package/build/module/runtime/utils/instrumentDatabase.js +3 -2
  35. package/build/module/vite/addServerConfig.d.ts +23 -8
  36. package/build/module/vite/middlewareConfig.d.ts +2 -1
  37. package/build/module/vite/utils.d.ts +22 -3
  38. package/build/types/common/devMode.d.ts +12 -2
  39. package/build/types/common/devMode.d.ts.map +1 -1
  40. package/build/types/common/types.d.ts +7 -0
  41. package/build/types/common/types.d.ts.map +1 -1
  42. package/build/types/module.d.ts.map +1 -1
  43. package/build/types/runtime/utils/instrumentDatabase.d.ts.map +1 -1
  44. package/build/types/server/sdk.d.ts.map +1 -1
  45. package/build/types/vite/addServerConfig.d.ts +23 -8
  46. package/build/types/vite/addServerConfig.d.ts.map +1 -1
  47. package/build/types/vite/middlewareConfig.d.ts +2 -1
  48. package/build/types/vite/middlewareConfig.d.ts.map +1 -1
  49. package/build/types/vite/orchestrion.d.ts.map +1 -1
  50. package/build/types/vite/utils.d.ts +22 -3
  51. package/build/types/vite/utils.d.ts.map +1 -1
  52. package/package.json +9 -9
@@ -3,10 +3,26 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
3
  const core = require('@sentry/core');
4
4
 
5
5
  const NUXT_DEV_MODE_FLAG = "__SENTRY_NUXT_DEV_MODE__";
6
+ const NUXT_PRERENDER_FLAG = "__SENTRY_NUXT_PRERENDER__";
7
+ const NUXT_SERVER_INITIALIZED_FLAG = "__SENTRY_NUXT_SERVER_INITIALIZED__";
6
8
  function isNuxtDevRuntime() {
7
9
  return NUXT_DEV_MODE_FLAG in core.GLOBAL_OBJ && core.GLOBAL_OBJ[NUXT_DEV_MODE_FLAG] === true;
8
10
  }
11
+ function isNuxtPrerenderRuntime() {
12
+ return NUXT_PRERENDER_FLAG in core.GLOBAL_OBJ && core.GLOBAL_OBJ[NUXT_PRERENDER_FLAG] === true;
13
+ }
14
+ function isNuxtServerInitialized() {
15
+ return NUXT_SERVER_INITIALIZED_FLAG in core.GLOBAL_OBJ && core.GLOBAL_OBJ[NUXT_SERVER_INITIALIZED_FLAG] === true;
16
+ }
17
+ function markNuxtServerInitialized() {
18
+ core.GLOBAL_OBJ[NUXT_SERVER_INITIALIZED_FLAG] = true;
19
+ }
9
20
 
10
21
  exports.NUXT_DEV_MODE_FLAG = NUXT_DEV_MODE_FLAG;
22
+ exports.NUXT_PRERENDER_FLAG = NUXT_PRERENDER_FLAG;
23
+ exports.NUXT_SERVER_INITIALIZED_FLAG = NUXT_SERVER_INITIALIZED_FLAG;
11
24
  exports.isNuxtDevRuntime = isNuxtDevRuntime;
25
+ exports.isNuxtPrerenderRuntime = isNuxtPrerenderRuntime;
26
+ exports.isNuxtServerInitialized = isNuxtServerInitialized;
27
+ exports.markNuxtServerInitialized = markNuxtServerInitialized;
12
28
  //# sourceMappingURL=devMode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"devMode.js","sources":["../../../src/common/devMode.ts"],"sourcesContent":["import { GLOBAL_OBJ } from '@sentry/core';\n\n/** Global flag set by the generated `<buildDir>/dev/sentry.server.config.mjs`. */\nexport const NUXT_DEV_MODE_FLAG = '__SENTRY_NUXT_DEV_MODE__';\n\n/** Whether the SDK was preloaded by the generated `nuxt dev` server config file. */\nexport function isNuxtDevRuntime(): boolean {\n return NUXT_DEV_MODE_FLAG in GLOBAL_OBJ && GLOBAL_OBJ[NUXT_DEV_MODE_FLAG] === true;\n}\n"],"names":["GLOBAL_OBJ"],"mappings":";;;;AAGO,MAAM,kBAAA,GAAqB;AAG3B,SAAS,gBAAA,GAA4B;AAC1C,EAAA,OAAO,kBAAA,IAAsBA,eAAA,IAAcA,eAAA,CAAW,kBAAkB,CAAA,KAAM,IAAA;AAChF;;;;;"}
1
+ {"version":3,"file":"devMode.js","sources":["../../../src/common/devMode.ts"],"sourcesContent":["import { GLOBAL_OBJ } from '@sentry/core';\n\n/** Global flag set by the generated runtime-flags module before the Sentry server config evaluates. */\nexport const NUXT_DEV_MODE_FLAG = '__SENTRY_NUXT_DEV_MODE__';\n\n/** Global flag set by the generated runtime-flags module during a prerender build. */\nexport const NUXT_PRERENDER_FLAG = '__SENTRY_NUXT_PRERENDER__';\n\n/** Global flag set by the Nuxt server SDK after a successful `init`, to guard against a second init. */\nexport const NUXT_SERVER_INITIALIZED_FLAG = '__SENTRY_NUXT_SERVER_INITIALIZED__';\n\n/** Whether the server runs in `nuxt dev`. */\nexport function isNuxtDevRuntime(): boolean {\n return NUXT_DEV_MODE_FLAG in GLOBAL_OBJ && GLOBAL_OBJ[NUXT_DEV_MODE_FLAG] === true;\n}\n\n/** Whether the server bundle is executed by the Nitro prerenderer at build time. */\nexport function isNuxtPrerenderRuntime(): boolean {\n return NUXT_PRERENDER_FLAG in GLOBAL_OBJ && GLOBAL_OBJ[NUXT_PRERENDER_FLAG] === true;\n}\n\n/** Whether a Nuxt server SDK `init` already ran in this process. */\nexport function isNuxtServerInitialized(): boolean {\n return NUXT_SERVER_INITIALIZED_FLAG in GLOBAL_OBJ && GLOBAL_OBJ[NUXT_SERVER_INITIALIZED_FLAG] === true;\n}\n\n/** Records that the Nuxt server SDK initialized in this process. */\nexport function markNuxtServerInitialized(): void {\n (GLOBAL_OBJ as typeof GLOBAL_OBJ & { [NUXT_SERVER_INITIALIZED_FLAG]?: boolean })[NUXT_SERVER_INITIALIZED_FLAG] = true;\n}\n"],"names":["GLOBAL_OBJ"],"mappings":";;;;AAGO,MAAM,kBAAA,GAAqB;AAG3B,MAAM,mBAAA,GAAsB;AAG5B,MAAM,4BAAA,GAA+B;AAGrC,SAAS,gBAAA,GAA4B;AAC1C,EAAA,OAAO,kBAAA,IAAsBA,eAAA,IAAcA,eAAA,CAAW,kBAAkB,CAAA,KAAM,IAAA;AAChF;AAGO,SAAS,sBAAA,GAAkC;AAChD,EAAA,OAAO,mBAAA,IAAuBA,eAAA,IAAcA,eAAA,CAAW,mBAAmB,CAAA,KAAM,IAAA;AAClF;AAGO,SAAS,uBAAA,GAAmC;AACjD,EAAA,OAAO,4BAAA,IAAgCA,eAAA,IAAcA,eAAA,CAAW,4BAA4B,CAAA,KAAM,IAAA;AACpG;AAGO,SAAS,yBAAA,GAAkC;AAChD,EAACA,eAAA,CAAgF,4BAA4B,CAAA,GAAI,IAAA;AACnH;;;;;;;;;;"}
@@ -25,7 +25,9 @@ const module$1 = kit.defineNuxtModule({
25
25
  }
26
26
  const moduleOptions = {
27
27
  ...moduleOptionsParam,
28
+ // oxlint-disable-next-line typescript/no-deprecated -- supported until removal
28
29
  autoInjectServerSentry: moduleOptionsParam.autoInjectServerSentry,
30
+ // oxlint-disable-next-line typescript/no-deprecated -- supported until removal
29
31
  experimental_entrypointWrappedFunctions: moduleOptionsParam.experimental_entrypointWrappedFunctions || [
30
32
  "default",
31
33
  "handler",
@@ -59,11 +61,15 @@ const module$1 = kit.defineNuxtModule({
59
61
  });
60
62
  }
61
63
  const serverConfigFile = await utils.findDefaultSdkInitFile("server", nuxt, moduleOptions);
62
- const isNitroV3 = await utils.getNitroMajorVersion() >= 3;
64
+ const isNitroV3 = await utils.getNitroMajorVersion(nuxt.options.rootDir) >= 3;
63
65
  const nuxtMajor = parseInt(nuxt._version?.split(".")[0] ?? "3", 10);
64
66
  const isMinNuxtV4 = nuxtMajor >= 4;
65
67
  orchestrion.setupOrchestrion(nuxt, !!serverConfigFile, moduleOptions.buildTimeInstrumentation);
68
+ const usesDeprecatedInjectMode = moduleOptions.autoInjectServerSentry === "top-level-import" || moduleOptions.autoInjectServerSentry === "experimental_dynamic-import";
66
69
  if (serverConfigFile) {
70
+ if (!usesDeprecatedInjectMode) {
71
+ addServerConfig.addServerConfigPlugin(nuxt, serverConfigFile);
72
+ }
67
73
  if (isNitroV3) {
68
74
  kit.addServerPlugin(moduleDirResolver.resolve("./runtime/plugins/handler.server"));
69
75
  kit.addServerPlugin(moduleDirResolver.resolve("./runtime/plugins/update-route-name.server"));
@@ -80,9 +86,6 @@ const module$1 = kit.defineNuxtModule({
80
86
  middlewareConfig.addMiddlewareImports();
81
87
  storageConfig.addStorageInstrumentation(nuxt, !isNitroV3);
82
88
  databaseConfig.addDatabaseInstrumentation(nuxt.options.nitro, !isNitroV3, moduleOptions);
83
- if (isNitroV3) {
84
- addServerConfig.addDevServerConfigFile(nuxt, serverConfigFile);
85
- }
86
89
  }
87
90
  if (clientConfigFile || serverConfigFile) {
88
91
  sourceMaps.setupSourceMaps(moduleOptions, nuxt, kit.addVitePlugin);
@@ -126,56 +129,37 @@ const module$1 = kit.defineNuxtModule({
126
129
  return;
127
130
  }
128
131
  if (serverConfigFile) {
129
- middlewareConfig.addMiddlewareInstrumentation(nitro);
130
- core.consoleSandbox(() => {
131
- const serverDir = nitro.options.output.serverDir;
132
- if (serverDir.includes(".netlify") || !!process.env.NETLIFY) {
133
- console.warn(
134
- "[Sentry] Warning: The Sentry SDK detected a Netlify build. Server-side support for the Sentry Nuxt SDK on Netlify is currently unreliable due to technical limitations of serverless functions. Traces are not collected, and errors may occasionally not be reported. For more information on setting up Sentry on the Nuxt server-side, please refer to the documentation: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/"
135
- );
136
- }
137
- if (serverDir.includes(".vercel") || !!process.env.VERCEL) {
138
- console.warn(
139
- "[Sentry] Warning: The Sentry SDK detected a Vercel build. The Sentry Nuxt SDK currently does not support tracing on Vercel. For more information on setting up Sentry on the Nuxt server-side, please refer to the documentation: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/"
140
- );
141
- }
142
- });
143
- if (moduleOptions.autoInjectServerSentry !== "experimental_dynamic-import") {
144
- if (!(isNitroV3 && nitro.options.dev)) {
145
- addServerConfig.addServerConfigToBuild(moduleOptions, nitro, serverConfigFile);
146
- }
132
+ middlewareConfig.addMiddlewareInstrumentation(nitro, isNitroV3);
133
+ if (!usesDeprecatedInjectMode) {
134
+ addServerConfig.addServerConfigShimWithWarning(nitro);
147
135
  if (moduleOptions.debug) {
148
- const serverDirResolver = kit.createResolver(nitro.options.output.serverDir);
149
- const serverConfigPath = serverDirResolver.resolve("sentry.server.config.mjs");
150
- const serverConfigRelativePath = utils.toImportSpecifier(nitro.options.rootDir, serverConfigPath);
151
- const devConfigRelativePath = isNitroV3 ? utils.toImportSpecifier(nuxt.options.rootDir, path.join(nuxt.options.buildDir, addServerConfig.DEV_SERVER_CONFIG_PATH)) : serverConfigRelativePath;
152
136
  core.consoleSandbox(() => {
153
137
  console.log(
154
- `[Sentry] Using \`${serverConfigFile}\` for server-side Sentry configuration. To activate Sentry on the Nuxt server-side, this file must be preloaded when starting your application. Make sure to add this where you deploy and/or run your application. Read more here: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/.`
138
+ `[Sentry] Bundled \`${serverConfigFile}\` into the Nitro server build. The SDK initializes itself at server startup \u2014 no \`node --import\` preload needed.`
155
139
  );
156
- if (nitro.options.dev) {
157
- console.log(
158
- `[Sentry] During development, preload Sentry with the NODE_OPTIONS environment variable: \`NODE_OPTIONS='--import ${devConfigRelativePath}' nuxt dev\`. The file is generated in the build directory (usually '.nuxt'). If you delete the build directory, run \`nuxt prepare\` to regenerate it.`
159
- );
160
- } else {
161
- console.log(
162
- `[Sentry] When running your built application, preload Sentry via a command-line flag (\`node --import ${serverConfigRelativePath} [...]\`) or via an environment variable (\`NODE_OPTIONS='--import ${serverConfigRelativePath}' node [...]\`).`
163
- );
164
- }
165
140
  });
166
141
  }
167
- }
168
- if (moduleOptions.autoInjectServerSentry === "top-level-import") {
169
- addServerConfig.addSentryTopImport(moduleOptions, nitro);
170
- }
171
- if (moduleOptions.autoInjectServerSentry === "experimental_dynamic-import") {
172
- addServerConfig.addDynamicImportEntryFileWrapper(nitro, serverConfigFile, moduleOptions);
173
- if (moduleOptions.debug) {
174
- core.consoleSandbox(() => {
175
- console.log(
176
- "[Sentry] Wrapping the server entry file with a dynamic `import()`, so Sentry can be preloaded before the server initializes."
177
- );
178
- });
142
+ } else {
143
+ core.consoleSandbox(() => {
144
+ console.warn(
145
+ `[Sentry] \`autoInjectServerSentry: '${moduleOptions.autoInjectServerSentry}'\` is deprecated and will be removed in a future major version. The Sentry server config is bundled into the Nitro server build by default now. Remove the option to use the default behavior.`
146
+ );
147
+ });
148
+ if (moduleOptions.autoInjectServerSentry === "top-level-import") {
149
+ if (!(isNitroV3 && nitro.options.dev)) {
150
+ addServerConfig.addServerConfigToBuild(moduleOptions, nitro, serverConfigFile);
151
+ }
152
+ addServerConfig.addSentryTopImport(moduleOptions, nitro);
153
+ }
154
+ if (moduleOptions.autoInjectServerSentry === "experimental_dynamic-import") {
155
+ addServerConfig.addDynamicImportEntryFileWrapper(nitro, serverConfigFile, moduleOptions);
156
+ if (moduleOptions.debug) {
157
+ core.consoleSandbox(() => {
158
+ console.log(
159
+ "[Sentry] Wrapping the server entry file with a dynamic `import()`, so Sentry can be preloaded before the server initializes."
160
+ );
161
+ });
162
+ }
179
163
  }
180
164
  }
181
165
  }
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../src/module.ts"],"sourcesContent":["import {\n addPlugin,\n addPluginTemplate,\n addServerPlugin,\n addTemplate,\n addVitePlugin,\n createResolver,\n defineNuxtModule,\n} from '@nuxt/kit';\n// Needed to make TS evaluate the augmentation of Nitro types (https://github.com/nuxt/nuxt/pull/34039)\nimport type {} from '@nuxt/nitro-server';\n\nimport { consoleSandbox } from '@sentry/core';\nimport * as path from 'path';\nimport type { SentryNuxtModuleOptions } from './common/types';\nimport {\n addDevServerConfigFile,\n addDynamicImportEntryFileWrapper,\n addSentryTopImport,\n addServerConfigToBuild,\n DEV_SERVER_CONFIG_PATH,\n} from './vite/addServerConfig';\nimport { addDatabaseInstrumentation } from './vite/databaseConfig';\nimport { addMiddlewareImports, addMiddlewareInstrumentation } from './vite/middlewareConfig';\nimport { setupOrchestrion } from './vite/orchestrion';\nimport { setupSourceMaps } from './vite/sourceMaps';\nimport { addStorageInstrumentation } from './vite/storageConfig';\nimport {\n addOTelCommonJSImportAlias,\n findDefaultSdkInitFile,\n getNitroMajorVersion,\n toImportSpecifier,\n} from './vite/utils';\n\nexport type ModuleOptions = SentryNuxtModuleOptions;\ntype NuxtPageSubset = { file?: string; path: string };\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: '@sentry/nuxt/module',\n configKey: 'sentry',\n compatibility: {\n nuxt: '>=3.7.0',\n },\n },\n defaults: {},\n async setup(moduleOptionsParam, nuxt) {\n if (moduleOptionsParam?.enabled === false) {\n return;\n }\n\n const moduleOptions = {\n ...moduleOptionsParam,\n autoInjectServerSentry: moduleOptionsParam.autoInjectServerSentry,\n experimental_entrypointWrappedFunctions: moduleOptionsParam.experimental_entrypointWrappedFunctions || [\n 'default',\n 'handler',\n 'server',\n ],\n };\n\n const moduleDirResolver = createResolver(import.meta.url);\n const buildDirResolver = createResolver(nuxt.options.buildDir);\n\n const clientConfigFile = await findDefaultSdkInitFile('client', nuxt, moduleOptions);\n\n if (clientConfigFile) {\n // Inject the client-side Sentry config file with a side effect import\n addPluginTemplate({\n mode: 'client',\n filename: 'sentry-client-config.mjs',\n order: 0,\n\n // Dynamic import of config file to wrap it within a Nuxt context (here: defineNuxtPlugin)\n // Makes it possible to call useRuntimeConfig() in the user-defined sentry config file\n getContents: () => `\n import { defineNuxtPlugin } from \"#imports\";\n\n export default defineNuxtPlugin({\n name: 'sentry-client-config',\n async setup() {\n await import(\"${buildDirResolver.resolve(`/${clientConfigFile}`)}\")\n }\n });`,\n });\n\n // Add the plugin which loads client integrations etc. -\n // this must run after the sentry-client-config plugin has run, and the client is initialized!\n addPlugin({\n src: moduleDirResolver.resolve('./runtime/plugins/sentry.client'),\n mode: 'client',\n order: 1,\n });\n }\n\n const serverConfigFile = await findDefaultSdkInitFile('server', nuxt, moduleOptions);\n const isNitroV3 = (await getNitroMajorVersion()) >= 3;\n const nuxtMajor = parseInt((nuxt as unknown as { _version: string })._version?.split('.')[0] ?? '3', 10);\n const isMinNuxtV4 = nuxtMajor >= 4;\n\n // Orchestrion runs on both the Node path (gated on a server config file) and the Cloudflare path\n // (which has no server config file — the SDK is set up via `sentryCloudflareNitroPlugin`). The\n // Cloudflare detection happens inside, keyed off the resolved Nitro preset.\n setupOrchestrion(nuxt, !!serverConfigFile, moduleOptions.buildTimeInstrumentation);\n\n if (serverConfigFile) {\n if (isNitroV3) {\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/handler.server'));\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/update-route-name.server'));\n } else {\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/handler-legacy.server'));\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/update-route-name-legacy.server'));\n }\n\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/sentry.server'));\n\n if (isMinNuxtV4) {\n addPlugin({ src: moduleDirResolver.resolve('./runtime/plugins/route-detector.server'), mode: 'server' });\n } else {\n addPlugin({ src: moduleDirResolver.resolve('./runtime/plugins/route-detector-legacy.server'), mode: 'server' });\n }\n\n // Preps the middleware instrumentation module.\n addMiddlewareImports();\n addStorageInstrumentation(nuxt, !isNitroV3);\n addDatabaseInstrumentation(nuxt.options.nitro, !isNitroV3, moduleOptions);\n\n // Outside `nitro:init` so that `nuxt prepare` writes the file before the first `nuxt dev`.\n if (isNitroV3) {\n addDevServerConfigFile(nuxt, serverConfigFile);\n }\n }\n\n if (clientConfigFile || serverConfigFile) {\n setupSourceMaps(moduleOptions, nuxt, addVitePlugin);\n }\n\n addOTelCommonJSImportAlias(nuxt, isNitroV3);\n\n let pagesData: NuxtPageSubset[] = [];\n\n nuxt.hooks.hook('pages:extend', pages => {\n pagesData = pages\n .map(page => ({ file: page.file, path: page.path }))\n .filter(page => {\n // Check for dynamic parameter (e.g., :userId or [userId])\n return page.path.includes(':') || page?.file?.includes('[');\n });\n });\n\n if (isMinNuxtV4) {\n const pagesDataVirtualModuleId = '#sentry/nuxt-pages-data.mjs';\n\n // Vite virtual plugin (for the Vite SSR build, where addPlugin mode:'server' plugins are bundled)\n addVitePlugin({\n name: 'sentry-nuxt-pages-data-virtual',\n resolveId: id => (id === pagesDataVirtualModuleId ? `\\0${pagesDataVirtualModuleId}` : null),\n load: id =>\n id === `\\0${pagesDataVirtualModuleId}` ? `export default ${JSON.stringify(pagesData, null, 2)};` : undefined,\n });\n } else {\n // Nuxt v3: register as a build template (accessible via #build/)\n addTemplate({\n filename: 'sentry--nuxt-pages-data.mjs',\n getContents: () => `export default ${JSON.stringify(pagesData, null, 2)};`,\n });\n }\n\n // Add the sentry config file to the include array\n nuxt.hook('prepare:types', options => {\n const tsConfig = options.tsConfig as { include?: string[] };\n\n if (!tsConfig.include) {\n tsConfig.include = [];\n }\n\n // Add type references for useRuntimeConfig in root files for nuxt v4\n // Should be relative to `root/.nuxt`\n if (clientConfigFile) {\n const relativePath = path.relative(nuxt.options.buildDir, clientConfigFile);\n tsConfig.include.push(relativePath);\n }\n if (serverConfigFile) {\n const relativePath = path.relative(nuxt.options.buildDir, serverConfigFile);\n tsConfig.include.push(relativePath);\n }\n });\n\n nuxt.hooks.hook('nitro:init', nitro => {\n if (nuxt.options?._prepare) {\n return;\n }\n\n if (serverConfigFile) {\n addMiddlewareInstrumentation(nitro);\n\n consoleSandbox(() => {\n const serverDir = nitro.options.output.serverDir;\n\n // Netlify env: https://docs.netlify.com/configure-builds/environment-variables/#build-metadata\n if (serverDir.includes('.netlify') || !!process.env.NETLIFY) {\n // eslint-disable-next-line no-console\n console.warn(\n '[Sentry] Warning: The Sentry SDK detected a Netlify build. Server-side support for the Sentry Nuxt SDK on Netlify is currently unreliable due to technical limitations of serverless functions. Traces are not collected, and errors may occasionally not be reported. For more information on setting up Sentry on the Nuxt server-side, please refer to the documentation: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/',\n );\n }\n\n // Vercel env: https://vercel.com/docs/projects/environment-variables/system-environment-variables#VERCEL\n if (serverDir.includes('.vercel') || !!process.env.VERCEL) {\n // eslint-disable-next-line no-console\n console.warn(\n '[Sentry] Warning: The Sentry SDK detected a Vercel build. The Sentry Nuxt SDK currently does not support tracing on Vercel. For more information on setting up Sentry on the Nuxt server-side, please refer to the documentation: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/',\n );\n }\n });\n\n if (moduleOptions.autoInjectServerSentry !== 'experimental_dynamic-import') {\n // Nitro 3 (in Nuxt 5) is not bundled in dev mode. See `addDevServerConfigFile` for how we add the file now.\n if (!(isNitroV3 && nitro.options.dev)) {\n addServerConfigToBuild(moduleOptions, nitro, serverConfigFile);\n }\n\n if (moduleOptions.debug) {\n const serverDirResolver = createResolver(nitro.options.output.serverDir);\n const serverConfigPath = serverDirResolver.resolve('sentry.server.config.mjs');\n\n // For the default nitro node-preset build output this relative path would be: ./.output/server/sentry.server.config.mjs\n const serverConfigRelativePath = toImportSpecifier(nitro.options.rootDir, serverConfigPath);\n const devConfigRelativePath = isNitroV3\n ? toImportSpecifier(nuxt.options.rootDir, path.join(nuxt.options.buildDir, DEV_SERVER_CONFIG_PATH))\n : serverConfigRelativePath;\n\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Using \\`${serverConfigFile}\\` for server-side Sentry configuration. To activate Sentry on the Nuxt server-side, this file must be preloaded when starting your application. Make sure to add this where you deploy and/or run your application. Read more here: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/.`,\n );\n\n if (nitro.options.dev) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] During development, preload Sentry with the NODE_OPTIONS environment variable: \\`NODE_OPTIONS='--import ${devConfigRelativePath}' nuxt dev\\`. The file is generated in the build directory (usually '.nuxt'). If you delete the build directory, run \\`nuxt prepare\\` to regenerate it.`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] When running your built application, preload Sentry via a command-line flag (\\`node --import ${serverConfigRelativePath} [...]\\`) or via an environment variable (\\`NODE_OPTIONS='--import ${serverConfigRelativePath}' node [...]\\`).`,\n );\n }\n });\n }\n }\n\n if (moduleOptions.autoInjectServerSentry === 'top-level-import') {\n addSentryTopImport(moduleOptions, nitro);\n }\n\n if (moduleOptions.autoInjectServerSentry === 'experimental_dynamic-import') {\n addDynamicImportEntryFileWrapper(nitro, serverConfigFile, moduleOptions);\n\n if (moduleOptions.debug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Wrapping the server entry file with a dynamic `import()`, so Sentry can be preloaded before the server initializes.',\n );\n });\n }\n }\n }\n });\n },\n});\n"],"names":["defineNuxtModule","createResolver","findDefaultSdkInitFile","addPluginTemplate","addPlugin","getNitroMajorVersion","setupOrchestrion","addServerPlugin","addMiddlewareImports","addStorageInstrumentation","addDatabaseInstrumentation","addDevServerConfigFile","setupSourceMaps","addVitePlugin","addOTelCommonJSImportAlias","addTemplate","addMiddlewareInstrumentation","consoleSandbox","addServerConfigToBuild","toImportSpecifier","DEV_SERVER_CONFIG_PATH","addSentryTopImport","addDynamicImportEntryFileWrapper"],"mappings":";;;;;;;;;;;;AAqCA,iBAAeA,oBAAA,CAAgC;AAAA,EAC7C,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,qBAAA;AAAA,IACN,SAAA,EAAW,QAAA;AAAA,IACX,aAAA,EAAe;AAAA,MACb,IAAA,EAAM;AAAA;AACR,GACF;AAAA,EACA,UAAU,EAAC;AAAA,EACX,MAAM,KAAA,CAAM,kBAAA,EAAoB,IAAA,EAAM;AACpC,IAAA,IAAI,kBAAA,EAAoB,YAAY,KAAA,EAAO;AACzC,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,aAAA,GAAgB;AAAA,MACpB,GAAG,kBAAA;AAAA,MACH,wBAAwB,kBAAA,CAAmB,sBAAA;AAAA,MAC3C,uCAAA,EAAyC,mBAAmB,uCAAA,IAA2C;AAAA,QACrG,SAAA;AAAA,QACA,SAAA;AAAA,QACA;AAAA;AACF,KACF;AAEA,IAAA,MAAM,iBAAA,GAAoBC,kBAAA,CAAe,2PAAe,CAAA;AACxD,IAAA,MAAM,gBAAA,GAAmBA,kBAAA,CAAe,IAAA,CAAK,OAAA,CAAQ,QAAQ,CAAA;AAE7D,IAAA,MAAM,gBAAA,GAAmB,MAAMC,4BAAA,CAAuB,QAAA,EAAU,MAAM,aAAa,CAAA;AAEnF,IAAA,IAAI,gBAAA,EAAkB;AAEpB,MAAAC,qBAAA,CAAkB;AAAA,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Plugin,\n addPluginTemplate,\n addServerPlugin,\n addTemplate,\n addVitePlugin,\n createResolver,\n defineNuxtModule,\n} from '@nuxt/kit';\n// Needed to make TS evaluate the augmentation of Nitro types (https://github.com/nuxt/nuxt/pull/34039)\nimport type {} from '@nuxt/nitro-server';\n\nimport { consoleSandbox } from '@sentry/core';\nimport * as path from 'path';\nimport type { SentryNuxtModuleOptions } from './common/types';\nimport {\n addDynamicImportEntryFileWrapper,\n addServerConfigShimWithWarning,\n addSentryTopImport,\n addServerConfigPlugin,\n addServerConfigToBuild,\n} from './vite/addServerConfig';\nimport { addDatabaseInstrumentation } from './vite/databaseConfig';\nimport { addMiddlewareImports, addMiddlewareInstrumentation } from './vite/middlewareConfig';\nimport { setupOrchestrion } from './vite/orchestrion';\nimport { setupSourceMaps } from './vite/sourceMaps';\nimport { addStorageInstrumentation } from './vite/storageConfig';\nimport { addOTelCommonJSImportAlias, findDefaultSdkInitFile, getNitroMajorVersion } from './vite/utils';\n\nexport type ModuleOptions = SentryNuxtModuleOptions;\ntype NuxtPageSubset = { file?: string; path: string };\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: '@sentry/nuxt/module',\n configKey: 'sentry',\n compatibility: {\n nuxt: '>=3.7.0',\n },\n },\n defaults: {},\n async setup(moduleOptionsParam, nuxt) {\n if (moduleOptionsParam?.enabled === false) {\n return;\n }\n\n const moduleOptions = {\n ...moduleOptionsParam,\n // oxlint-disable-next-line typescript/no-deprecated -- supported until removal\n autoInjectServerSentry: moduleOptionsParam.autoInjectServerSentry,\n // oxlint-disable-next-line typescript/no-deprecated -- supported until removal\n experimental_entrypointWrappedFunctions: moduleOptionsParam.experimental_entrypointWrappedFunctions || [\n 'default',\n 'handler',\n 'server',\n ],\n };\n\n const moduleDirResolver = createResolver(import.meta.url);\n const buildDirResolver = createResolver(nuxt.options.buildDir);\n\n const clientConfigFile = await findDefaultSdkInitFile('client', nuxt, moduleOptions);\n\n if (clientConfigFile) {\n // Inject the client-side Sentry config file with a side effect import\n addPluginTemplate({\n mode: 'client',\n filename: 'sentry-client-config.mjs',\n order: 0,\n\n // Dynamic import of config file to wrap it within a Nuxt context (here: defineNuxtPlugin)\n // Makes it possible to call useRuntimeConfig() in the user-defined sentry config file\n getContents: () => `\n import { defineNuxtPlugin } from \"#imports\";\n\n export default defineNuxtPlugin({\n name: 'sentry-client-config',\n async setup() {\n await import(\"${buildDirResolver.resolve(`/${clientConfigFile}`)}\")\n }\n });`,\n });\n\n // Add the plugin which loads client integrations etc. -\n // this must run after the sentry-client-config plugin has run, and the client is initialized!\n addPlugin({\n src: moduleDirResolver.resolve('./runtime/plugins/sentry.client'),\n mode: 'client',\n order: 1,\n });\n }\n\n const serverConfigFile = await findDefaultSdkInitFile('server', nuxt, moduleOptions);\n const isNitroV3 = (await getNitroMajorVersion(nuxt.options.rootDir)) >= 3;\n const nuxtMajor = parseInt((nuxt as unknown as { _version: string })._version?.split('.')[0] ?? '3', 10);\n const isMinNuxtV4 = nuxtMajor >= 4;\n\n // Orchestrion runs on both the Node path (gated on a server config file) and the Cloudflare path\n // (which has no server config file — the SDK is set up via `sentryCloudflareNitroPlugin`). The\n // Cloudflare detection happens inside, keyed off the resolved Nitro preset.\n setupOrchestrion(nuxt, !!serverConfigFile, moduleOptions.buildTimeInstrumentation);\n\n // The deprecated inject modes replace the default in-bundle initialization until their removal\n const usesDeprecatedInjectMode =\n moduleOptions.autoInjectServerSentry === 'top-level-import' ||\n moduleOptions.autoInjectServerSentry === 'experimental_dynamic-import';\n\n if (serverConfigFile) {\n if (!usesDeprecatedInjectMode) {\n addServerConfigPlugin(nuxt, serverConfigFile);\n }\n\n if (isNitroV3) {\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/handler.server'));\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/update-route-name.server'));\n } else {\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/handler-legacy.server'));\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/update-route-name-legacy.server'));\n }\n\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/sentry.server'));\n\n if (isMinNuxtV4) {\n addPlugin({ src: moduleDirResolver.resolve('./runtime/plugins/route-detector.server'), mode: 'server' });\n } else {\n addPlugin({ src: moduleDirResolver.resolve('./runtime/plugins/route-detector-legacy.server'), mode: 'server' });\n }\n\n // Preps the middleware instrumentation module.\n addMiddlewareImports();\n addStorageInstrumentation(nuxt, !isNitroV3);\n addDatabaseInstrumentation(nuxt.options.nitro, !isNitroV3, moduleOptions);\n }\n\n if (clientConfigFile || serverConfigFile) {\n setupSourceMaps(moduleOptions, nuxt, addVitePlugin);\n }\n\n addOTelCommonJSImportAlias(nuxt, isNitroV3);\n\n let pagesData: NuxtPageSubset[] = [];\n\n nuxt.hooks.hook('pages:extend', pages => {\n pagesData = pages\n .map(page => ({ file: page.file, path: page.path }))\n .filter(page => {\n // Check for dynamic parameter (e.g., :userId or [userId])\n return page.path.includes(':') || page?.file?.includes('[');\n });\n });\n\n if (isMinNuxtV4) {\n const pagesDataVirtualModuleId = '#sentry/nuxt-pages-data.mjs';\n\n // Vite virtual plugin (for the Vite SSR build, where addPlugin mode:'server' plugins are bundled)\n addVitePlugin({\n name: 'sentry-nuxt-pages-data-virtual',\n resolveId: id => (id === pagesDataVirtualModuleId ? `\\0${pagesDataVirtualModuleId}` : null),\n load: id =>\n id === `\\0${pagesDataVirtualModuleId}` ? `export default ${JSON.stringify(pagesData, null, 2)};` : undefined,\n });\n } else {\n // Nuxt v3: register as a build template (accessible via #build/)\n addTemplate({\n filename: 'sentry--nuxt-pages-data.mjs',\n getContents: () => `export default ${JSON.stringify(pagesData, null, 2)};`,\n });\n }\n\n // Add the sentry config file to the include array\n nuxt.hook('prepare:types', options => {\n const tsConfig = options.tsConfig as { include?: string[] };\n\n if (!tsConfig.include) {\n tsConfig.include = [];\n }\n\n // Add type references for useRuntimeConfig in root files for nuxt v4\n // Should be relative to `root/.nuxt`\n if (clientConfigFile) {\n const relativePath = path.relative(nuxt.options.buildDir, clientConfigFile);\n tsConfig.include.push(relativePath);\n }\n if (serverConfigFile) {\n const relativePath = path.relative(nuxt.options.buildDir, serverConfigFile);\n tsConfig.include.push(relativePath);\n }\n });\n\n nuxt.hooks.hook('nitro:init', nitro => {\n if (nuxt.options?._prepare) {\n return;\n }\n\n if (serverConfigFile) {\n addMiddlewareInstrumentation(nitro, isNitroV3);\n\n if (!usesDeprecatedInjectMode) {\n addServerConfigShimWithWarning(nitro);\n\n if (moduleOptions.debug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Bundled \\`${serverConfigFile}\\` into the Nitro server build. The SDK initializes itself at server startup — no \\`node --import\\` preload needed.`,\n );\n });\n }\n } else {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] \\`autoInjectServerSentry: '${moduleOptions.autoInjectServerSentry}'\\` is deprecated and will be removed in a future major version. The Sentry server config is bundled into the Nitro server build by default now. Remove the option to use the default behavior.`,\n );\n });\n\n if (moduleOptions.autoInjectServerSentry === 'top-level-import') {\n // Nitro 3 (in Nuxt 5) is not bundled in dev mode, so there is no build to emit into.\n if (!(isNitroV3 && nitro.options.dev)) {\n addServerConfigToBuild(moduleOptions, nitro, serverConfigFile);\n }\n addSentryTopImport(moduleOptions, nitro);\n }\n\n if (moduleOptions.autoInjectServerSentry === 'experimental_dynamic-import') {\n addDynamicImportEntryFileWrapper(nitro, serverConfigFile, moduleOptions);\n\n if (moduleOptions.debug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Wrapping the server entry file with a dynamic `import()`, so Sentry can be preloaded before the server initializes.',\n );\n });\n }\n }\n }\n }\n });\n },\n});\n"],"names":["defineNuxtModule","createResolver","findDefaultSdkInitFile","addPluginTemplate","addPlugin","getNitroMajorVersion","setupOrchestrion","addServerConfigPlugin","addServerPlugin","addMiddlewareImports","addStorageInstrumentation","addDatabaseInstrumentation","setupSourceMaps","addVitePlugin","addOTelCommonJSImportAlias","addTemplate","addMiddlewareInstrumentation","addServerConfigShimWithWarning","consoleSandbox","addServerConfigToBuild","addSentryTopImport","addDynamicImportEntryFileWrapper"],"mappings":";;;;;;;;;;;;AAgCA,iBAAeA,oBAAA,CAAgC;AAAA,EAC7C,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,qBAAA;AAAA,IACN,SAAA,EAAW,QAAA;AAAA,IACX,aAAA,EAAe;AAAA,MACb,IAAA,EAAM;AAAA;AACR,GACF;AAAA,EACA,UAAU,EAAC;AAAA,EACX,MAAM,KAAA,CAAM,kBAAA,EAAoB,IAAA,EAAM;AACpC,IAAA,IAAI,kBAAA,EAAoB,YAAY,KAAA,EAAO;AACzC,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,aAAA,GAAgB;AAAA,MACpB,GAAG,kBAAA;AAAA;AAAA,MAEH,wBAAwB,kBAAA,CAAmB,sBAAA;AAAA;AAAA,MAE3C,uCAAA,EAAyC,mBAAmB,uCAAA,IAA2C;AAAA,QACrG,SAAA;AAAA,QACA,SAAA;AAAA,QACA;AAAA;AACF,KACF;AAEA,IAAA,MAAM,iBAAA,GAAoBC,kBAAA,CAAe,2PAAe,CAAA;AACxD,IAAA,MAAM,gBAAA,GAAmBA,kBAAA,CAAe,IAAA,CAAK,OAAA,CAAQ,QAAQ,CAAA;AAE7D,IAAA,MAAM,gBAAA,GAAmB,MAAMC,4BAAA,CAAuB,QAAA,EAAU,MAAM,aAAa,CAAA;AAEnF,IAAA,IAAI,gBAAA,EAAkB;AAEpB,MAAAC,qBAAA,CAAkB;AAAA,QAChB,IAAA,EAAM,QAAA;AAAA,QACN,QAAA,EAAU,0BAAA;AAAA,QACV,KAAA,EAAO,CAAA;AAAA;AAAA;AAAA,QAIP,aAAa,MAAM;AAAA;;AAAA;AAAA;AAAA;AAAA,4BAAA,EAMG,gBAAA,CAAiB,OAAA,CAAQ,CAAA,CAAA,EAAI,gBAAgB,EAAE,CAAC,CAAA;AAAA;A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AAA,QACF;AAAA,MACF;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF,CAAC,CAAA;;;;"}
@@ -7,6 +7,18 @@ const debugBuild = require('../common/debug-build.js');
7
7
  const devMode = require('../common/devMode.js');
8
8
 
9
9
  function init(options) {
10
+ if (devMode.isNuxtPrerenderRuntime()) {
11
+ debugBuild.DEBUG_BUILD && core.debug.log("Detected a Nitro prerender build. Skipping Sentry server initialization.");
12
+ return void 0;
13
+ }
14
+ if (devMode.isNuxtServerInitialized()) {
15
+ core.consoleSandbox(() => {
16
+ console.log(
17
+ "[Sentry] The Sentry server SDK is already initialized, skipping a second initialization. The Sentry server config is bundled into the Nitro server build, so a `node --import` preload of the config file is no longer needed and can be removed."
18
+ );
19
+ });
20
+ return core.getClient();
21
+ }
10
22
  const envFallback = devMode.isNuxtDevRuntime() ? core.DEV_ENVIRONMENT : core.DEFAULT_ENVIRONMENT;
11
23
  const sentryOptions = {
12
24
  environment: options.environment ?? process.env.SENTRY_ENVIRONMENT ?? envFallback,
@@ -14,6 +26,9 @@ function init(options) {
14
26
  };
15
27
  core.applySdkMetadata(sentryOptions, "nuxt", ["nuxt", "node"]);
16
28
  const client = node.init(sentryOptions);
29
+ if (client) {
30
+ devMode.markNuxtServerInitialized();
31
+ }
17
32
  core.getGlobalScope().addEventProcessor(lowQualityTransactionsFilter(options));
18
33
  core.getGlobalScope().addEventProcessor(clientSourceMapErrorFilter(options));
19
34
  return client;
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { Client, Event, EventProcessor } from '@sentry/core';\nimport { applySdkMetadata, debug, DEFAULT_ENVIRONMENT, DEV_ENVIRONMENT, getGlobalScope } from '@sentry/core';\nimport { init as initNode } from '@sentry/node';\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { isNuxtDevRuntime } from '../common/devMode';\nimport type { SentryNuxtServerOptions } from '../common/types';\n\n/**\n * Initializes the server-side of the Nuxt SDK\n *\n * @param options Configuration options for the SDK.\n */\nexport function init(options: SentryNuxtServerOptions): Client | undefined {\n let isDevBuild = false;\n /*! rollup-include-esm-only */\n isDevBuild = !!import.meta.dev;\n /*! rollup-include-esm-only-end */\n\n // Nitro v3 does not bundle the Sentry server config file, so `import.meta.dev` stays undefined there\n const envFallback = isDevBuild || isNuxtDevRuntime() ? DEV_ENVIRONMENT : DEFAULT_ENVIRONMENT;\n\n const sentryOptions = {\n environment: options.environment ?? process.env.SENTRY_ENVIRONMENT ?? envFallback,\n ...options,\n };\n\n applySdkMetadata(sentryOptions, 'nuxt', ['nuxt', 'node']);\n\n const client = initNode(sentryOptions);\n\n getGlobalScope().addEventProcessor(lowQualityTransactionsFilter(options));\n getGlobalScope().addEventProcessor(clientSourceMapErrorFilter(options));\n\n return client;\n}\n\n/**\n * Filter out transactions for resource requests which we don't want to send to Sentry\n * for quota reasons.\n *\n * Only exported for testing\n */\nexport function lowQualityTransactionsFilter(options: SentryNuxtServerOptions): EventProcessor {\n return Object.assign(\n (event => {\n if (event.type !== 'transaction' || !event.transaction || isCacheEvent(event)) {\n return event;\n }\n\n // Check if this looks like a parametrized route (contains :param or :param() patterns)\n const hasRouteParameters = /\\/:[^(/\\s]*(\\([^)]*\\))?[^/\\s]*/.test(event.transaction);\n\n if (hasRouteParameters) {\n return event;\n }\n\n // We don't want to send transaction for file requests, so everything ending with a *.someExtension should be filtered out\n // path.extname will return an empty string for normal page requests\n if (path.extname(event.transaction)) {\n options.debug &&\n DEBUG_BUILD &&\n debug.log('NuxtLowQualityTransactionsFilter filtered transaction: ', event.transaction);\n return null;\n }\n return event;\n }) satisfies EventProcessor,\n { id: 'NuxtLowQualityTransactionsFilter' },\n );\n}\n\n/**\n * The browser devtools try to get the source maps, but as client source maps may not be available there is going to be an error (no problem for the application though).\n *\n * Only exported for testing\n */\nexport function clientSourceMapErrorFilter(options: SentryNuxtServerOptions): EventProcessor {\n return Object.assign(\n (event => {\n const errorMsg = event.exception?.values?.[0]?.value;\n if (errorMsg?.match(/^ENOENT: no such file or directory, open '.*\\/_nuxt\\/.*\\.js\\.map'/)) {\n options.debug && DEBUG_BUILD && debug.log('NuxtClientSourceMapErrorFilter filtered error: ', errorMsg);\n return null;\n }\n return event;\n }) satisfies EventProcessor,\n { id: 'NuxtClientSourceMapErrorFilter' },\n );\n}\n\n/**\n * Checks if the event is a cache event.\n */\nfunction isCacheEvent(e: Event): boolean {\n return e.contexts?.trace?.origin === 'auto.cache.nuxt';\n}\n"],"names":["isNuxtDevRuntime","DEV_ENVIRONMENT","DEFAULT_ENVIRONMENT","applySdkMetadata","initNode","getGlobalScope","DEBUG_BUILD","debug"],"mappings":";;;;;;;;AAaO,SAAS,KAAK,OAAA,EAAsD;AACxD,EACjB,MAAA,WAAA,GAAAA,wBAAA,EAAA,GAAAC,oBAAA,GAAAC,wBAAA;AACA,EAAA,MAAA,aAAe,GAAA;AAAY,IAC3B,WAAA,EAAA,OAAA,CAAA,WAAA,IAAA,OAAA,CAAA,GAAA,CAAA,kBAAA,IAAA,WAAA;AAGA,IAAA,GAAA;AAEA,GAAA;AAAsB,EAAAC,qBACP,CAAA,aAAQ,EAAA,MAAe,EAAA,CAAA,cAAY,CAAA,CAAA;AAAsB,EAAA,MACnE,MAAA,GAAAC,SAAA,CAAA,aAAA,CAAA;AAAA,EACLC,mBAAA,EAAA,CAAA,iBAAA,CAAA,4BAAA,CAAA,OAAA,CAAA,CAAA;AAEA,EAAAA,mBAAA,EAAA,CAAiB,iBAAe,CAAA,0BAAwB,CAAA,OAAA,CAAA,CAAA;AAExD,EAAA,OAAM,MAAA;AAEN;AACA,SAAA,4BAAmC,CAAA,OAAA,EAAA;AAEnC,EAAA,OAAO,MAAA,CAAA,MAAA;AACT,KAAA,CAAA,KAAA,KAAA;AAQO,MAAA,IAAA,KAAA,CAAS,gCAA6B,CAAA,WAAkD,IAAA,YAAA,CAAA,KAAA,CAAA,EAAA;AAC7F,QAAA,OAAO,KAAO;AAAA,MACX;AACC,MAAA,MAAI,kBAAe,GAAA,gCAAuC,CAAA,IAAA,CAAA,KAAA,CAAa,WAAQ,CAAA;AAC7E,MAAA,IAAA,kBAAO,EAAA;AAAA,QACT,OAAA,KAAA;AAGA,MAAA;AAEA,MAAA,IAAI,IAAA,CAAA,OAAA,CAAA,KAAA,CAAA,WAAoB,CAAA,EAAA;AACtB,QAAA,OAAO,CAAA,KAAA,IAAAC,sBAAA,IAAAC,UAAA,CAAA,GAAA,CAAA,yDAAA,EAAA,KAAA,CAAA,WAAA,CAAA;AAAA,QACT,OAAA,IAAA;AAIA,MAAA;AACE,MAAA,OAAA;AAGA,IAAA,CAAA;AAAO,IAAA,EACT,EAAA,EAAA,kCAAA;AACA,GAAA;AAAO;SAEH,0BAAA,CAAA,OAAmC,EAAA;AAAA,EAC3C,OAAA,MAAA,CAAA,MAAA;AACF,KAAA,CAAA,KAAA,KAAA;AAOO,MAAA,MAAA,kCAAoC,GAAA,CAAA,CAAA,EAAkD,KAAA;AAC3F,MAAA,IAAO,QAAO,EAAA,KAAA,CAAA,mEAAA,CAAA,EAAA;AAAA,QACX,OAAA,CAAS,KAAA,IAAAD,sBAAA,IAAAC,UAAA,CAAA,GAAA,CAAA,iDAAA,EAAA,QAAA,CAAA;AACR,QAAA,OAAM,IAAA;AACN,MAAA;AACE,MAAA,OAAA,KAAQ;AACR,IAAA,CAAA;AAAO,IAAA,EACT,EAAA,EAAA,gCAAA;AACA,GAAA;AAAO;AACT,qBACM,CAAA,CAAA,EAAA;AAAiC,EACzC,OAAA,CAAA,CAAA,QAAA,EAAA,KAAA,EAAA,MAAA,KAAA,iBAAA;AACF;;;;;;"}
1
+ {"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { Client, Event, EventProcessor } from '@sentry/core';\nimport {\n applySdkMetadata,\n consoleSandbox,\n debug,\n DEFAULT_ENVIRONMENT,\n DEV_ENVIRONMENT,\n getClient,\n getGlobalScope,\n} from '@sentry/core';\nimport { init as initNode } from '@sentry/node';\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport {\n isNuxtDevRuntime,\n isNuxtPrerenderRuntime,\n isNuxtServerInitialized,\n markNuxtServerInitialized,\n} from '../common/devMode';\nimport type { SentryNuxtServerOptions } from '../common/types';\n\n/**\n * Initializes the server-side of the Nuxt SDK\n *\n * @param options Configuration options for the SDK.\n */\nexport function init(options: SentryNuxtServerOptions): Client | undefined {\n // The prerenderer executes the server bundle (including nitro plugins) at build time (pollutes release health and adds build-time traces)\n if (isNuxtPrerenderRuntime()) {\n // potential follow-up: configurable with `capturePrerenderErrors`\n DEBUG_BUILD && debug.log('Detected a Nitro prerender build. Skipping Sentry server initialization.');\n return undefined;\n }\n\n // Since the server config is bundled into the Nitro build, a `node --import` preload of a config\n // file initializes the SDK a second time. The first init wins so a preload keeps its semantics.\n if (isNuxtServerInitialized()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] The Sentry server SDK is already initialized, skipping a second initialization. The Sentry server config is bundled into the Nitro server build, so a `node --import` preload of the config file is no longer needed and can be removed.',\n );\n });\n return getClient();\n }\n\n let isDevBuild = false;\n /*! rollup-include-esm-only */\n isDevBuild = !!import.meta.dev;\n /*! rollup-include-esm-only-end */\n\n // `import.meta.dev` is only substituted when this file itself is bundled; the generated\n // runtime-flags module sets the global flag for the (usual) externalized case.\n const envFallback = isDevBuild || isNuxtDevRuntime() ? DEV_ENVIRONMENT : DEFAULT_ENVIRONMENT;\n\n const sentryOptions = {\n environment: options.environment ?? process.env.SENTRY_ENVIRONMENT ?? envFallback,\n ...options,\n };\n\n applySdkMetadata(sentryOptions, 'nuxt', ['nuxt', 'node']);\n\n const client = initNode(sentryOptions);\n\n if (client) {\n markNuxtServerInitialized();\n }\n\n getGlobalScope().addEventProcessor(lowQualityTransactionsFilter(options));\n getGlobalScope().addEventProcessor(clientSourceMapErrorFilter(options));\n\n return client;\n}\n\n/**\n * Filter out transactions for resource requests which we don't want to send to Sentry\n * for quota reasons.\n *\n * Only exported for testing\n */\nexport function lowQualityTransactionsFilter(options: SentryNuxtServerOptions): EventProcessor {\n return Object.assign(\n (event => {\n if (event.type !== 'transaction' || !event.transaction || isCacheEvent(event)) {\n return event;\n }\n\n // Check if this looks like a parametrized route (contains :param or :param() patterns)\n const hasRouteParameters = /\\/:[^(/\\s]*(\\([^)]*\\))?[^/\\s]*/.test(event.transaction);\n\n if (hasRouteParameters) {\n return event;\n }\n\n // We don't want to send transaction for file requests, so everything ending with a *.someExtension should be filtered out\n // path.extname will return an empty string for normal page requests\n if (path.extname(event.transaction)) {\n options.debug &&\n DEBUG_BUILD &&\n debug.log('NuxtLowQualityTransactionsFilter filtered transaction: ', event.transaction);\n return null;\n }\n return event;\n }) satisfies EventProcessor,\n { id: 'NuxtLowQualityTransactionsFilter' },\n );\n}\n\n/**\n * The browser devtools try to get the source maps, but as client source maps may not be available there is going to be an error (no problem for the application though).\n *\n * Only exported for testing\n */\nexport function clientSourceMapErrorFilter(options: SentryNuxtServerOptions): EventProcessor {\n return Object.assign(\n (event => {\n const errorMsg = event.exception?.values?.[0]?.value;\n if (errorMsg?.match(/^ENOENT: no such file or directory, open '.*\\/_nuxt\\/.*\\.js\\.map'/)) {\n options.debug && DEBUG_BUILD && debug.log('NuxtClientSourceMapErrorFilter filtered error: ', errorMsg);\n return null;\n }\n return event;\n }) satisfies EventProcessor,\n { id: 'NuxtClientSourceMapErrorFilter' },\n );\n}\n\n/**\n * Checks if the event is a cache event.\n */\nfunction isCacheEvent(e: Event): boolean {\n return e.contexts?.trace?.origin === 'auto.cache.nuxt';\n}\n"],"names":["isNuxtPrerenderRuntime","DEBUG_BUILD","debug","isNuxtServerInitialized","consoleSandbox","getClient","isNuxtDevRuntime","DEV_ENVIRONMENT","DEFAULT_ENVIRONMENT","applySdkMetadata","initNode","markNuxtServerInitialized","getGlobalScope"],"mappings":";;;;;;;;AA0BO,SAAS,KAAK,OAAA,EAAsD;AAE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AAA;AAC7E,MAAA,IAAA,kBAAO,EAAA;AAAA,QACT,OAAA,KAAA;AAGA,MAAA;AAEA,MAAA,IAAI,IAAA,CAAA,OAAA,CAAA,KAAA,CAAA,WAAoB,CAAA,EAAA;AACtB,QAAA,OAAO,CAAA,KAAA,IAAAX,sBAAA,IAAAC,UAAA,CAAA,GAAA,CAAA,yDAAA,EAAA,KAAA,CAAA,WAAA,CAAA;AAAA,QACT,OAAA,IAAA;AAIA,MAAA;AACE,MAAA,OAAA;AAGA,IAAA,CAAA;AAAO,IAAA,EACT,EAAA,EAAA,kCAAA;AACA,GAAA;AAAO;SAEH,0BAAA,CAAA,OAAmC,EAAA;AAAA,EAC3C,OAAA,MAAA,CAAA,MAAA;AACF,KAAA,CAAA,KAAA,KAAA;AAOO,MAAA,MAAA,kCAAoC,GAAA,CAAA,CAAA,EAAkD,KAAA;AAC3F,MAAA,IAAO,QAAO,EAAA,KAAA,CAAA,mEAAA,CAAA,EAAA;AAAA,QACX,OAAA,CAAS,KAAA,IAAAD,sBAAA,IAAAC,UAAA,CAAA,GAAA,CAAA,iDAAA,EAAA,QAAA,CAAA;AACR,QAAA,OAAM,IAAA;AACN,MAAA;AACE,MAAA,OAAA,KAAQ;AACR,IAAA,CAAA;AAAO,IAAA,EACT,EAAA,EAAA,gCAAA;AACA,GAAA;AAAO;AACT,qBACM,CAAA,CAAA,EAAA;AAAiC,EACzC,OAAA,CAAA,CAAA,QAAA,EAAA,KAAA,EAAA,MAAA,KAAA,iBAAA;AACF;;;;;;"}
@@ -1,38 +1,21 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const node_fs = require('node:fs');
4
+ const path = require('node:path');
4
5
  const node_url = require('node:url');
5
6
  const kit = require('@nuxt/kit');
6
7
  const core = require('@sentry/core');
7
8
  const fs = require('fs');
8
- const path = require('path');
9
9
  const devMode = require('../common/devMode.js');
10
10
  const utils = require('./utils.js');
11
11
 
12
- const DEV_SERVER_CONFIG_PATH = `dev/${utils.SERVER_CONFIG_FILENAME}.mjs`;
13
- function addDevServerConfigFile(nuxt, serverConfigFile) {
14
- const configPath = kit.createResolver(nuxt.options.rootDir).resolve(`/${serverConfigFile}`);
15
- const importSpecifier = utils.toImportSpecifier(
16
- nuxt.options.rootDir,
17
- path.join(nuxt.options.buildDir, DEV_SERVER_CONFIG_PATH)
18
- );
19
- const failureMessage = `[Sentry] Could not load \`${path.basename(configPath)}\`, so Sentry is disabled during development. Node loads this file without a build step, so it supports neither path aliases (like #import) nor non-erasable TypeScript syntax (like enums).`;
20
- kit.addTemplate({
21
- filename: DEV_SERVER_CONFIG_PATH,
22
- write: true,
23
- getContents: () => [
24
- "// Generated by @sentry/nuxt. Preload it to enable Sentry during development:",
25
- `// NODE_OPTIONS='--import ${importSpecifier}' nuxt dev`,
26
- // A static import would hoist above this assignment, and would make a broken config crash the dev server.
27
- `globalThis.${devMode.NUXT_DEV_MODE_FLAG} = true;`,
28
- "try {",
29
- ` await import(${JSON.stringify(node_url.pathToFileURL(configPath).href)});`,
30
- "} catch (error) {",
31
- ` console.warn(${JSON.stringify(failureMessage)}, error);`,
32
- "}",
33
- ""
34
- ].join("\n")
35
- });
12
+ const CONFIG_EXTENSIONS = [".ts", ".js", ".mjs", ".cjs", ".mts", ".cts"];
13
+ function isServerConfigFile(sourcePath, resolvedPath) {
14
+ if (sourcePath === resolvedPath) {
15
+ return true;
16
+ }
17
+ const name = path.basename(sourcePath);
18
+ return name === utils.SERVER_CONFIG_FILENAME || CONFIG_EXTENSIONS.some((ext) => name === `${utils.SERVER_CONFIG_FILENAME}${ext}`);
36
19
  }
37
20
  function addServerConfigToBuild(moduleOptions, nitro, serverConfigFile) {
38
21
  nitro.hooks.hook("rollup:before", (nitro2, rollupConfig) => {
@@ -73,6 +56,78 @@ ${data}`;
73
56
  }
74
57
  });
75
58
  }
59
+ function addServerConfigPlugin(nuxt, serverConfigFile) {
60
+ const configPath = kit.createResolver(nuxt.options.rootDir).resolve(serverConfigFile);
61
+ const runtimeFlagsTemplate = kit.addTemplate({
62
+ filename: "sentry-runtime-flags.mjs",
63
+ write: true,
64
+ getContents: () => [
65
+ "// Generated by @sentry/nuxt. Sets runtime flags before the Sentry server config evaluates.",
66
+ `globalThis.${devMode.NUXT_DEV_MODE_FLAG} = import.meta.dev === true;`,
67
+ `globalThis.${devMode.NUXT_PRERENDER_FLAG} = import.meta.prerender === true;`,
68
+ ""
69
+ ].join("\n")
70
+ });
71
+ const configPluginTemplate = kit.addTemplate({
72
+ filename: "sentry-server-config-plugin.mjs",
73
+ write: true,
74
+ getContents: () => `import ${JSON.stringify(runtimeFlagsTemplate.dst)};
75
+ import ${JSON.stringify(configPath)};
76
+ export default () => {};
77
+ `
78
+ });
79
+ kit.addServerPlugin(configPluginTemplate.dst);
80
+ nuxt.options.nitro.moduleSideEffects = [
81
+ ...nuxt.options.nitro.moduleSideEffects ?? [],
82
+ configPath,
83
+ runtimeFlagsTemplate.dst
84
+ ];
85
+ nuxt.hook("nitro:config", (nitroConfig) => {
86
+ if (utils.isCloudflarePreset(nitroConfig.preset)) {
87
+ nitroConfig.plugins = (nitroConfig.plugins ?? []).filter((plugin) => plugin !== configPluginTemplate.dst);
88
+ return;
89
+ }
90
+ const plugins = nitroConfig.plugins ?? [];
91
+ nitroConfig.plugins = [configPluginTemplate.dst, ...plugins.filter((plugin) => plugin !== configPluginTemplate.dst)];
92
+ const externals = nitroConfig.externals ?? (nitroConfig.externals = {});
93
+ const inline = externals.inline;
94
+ const existingInline = Array.isArray(inline) ? inline : inline ? [inline] : [];
95
+ externals.inline = [...existingInline, configPath, configPluginTemplate.dst, runtimeFlagsTemplate.dst];
96
+ });
97
+ nuxt.hook("nitro:init", (nitro) => {
98
+ if (nuxt.options._prepare || !utils.isCloudflarePreset(nitro.options.preset)) {
99
+ return;
100
+ }
101
+ nitro.options.plugins = (nitro.options.plugins ?? []).filter((plugin) => plugin !== configPluginTemplate.dst);
102
+ core.consoleSandbox(() => {
103
+ console.warn(
104
+ `[Sentry] Found \`${path.basename(configPath)}\`, but the Nitro preset targets Cloudflare, where this file is not used. Set up the SDK with \`sentryCloudflareNitroPlugin\` instead: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/cloudflare-workers/`
105
+ );
106
+ });
107
+ });
108
+ }
109
+ function addServerConfigShimWithWarning(nitro) {
110
+ nitro.hooks.hook("close", async () => {
111
+ if (nitro.options.dev || nitro.options.preset === "nitro-prerender" || utils.isCloudflarePreset(nitro.options.preset)) {
112
+ return;
113
+ }
114
+ const shimPath = kit.createResolver(nitro.options.output.serverDir).resolve(`${utils.SERVER_CONFIG_FILENAME}.mjs`);
115
+ const contents = [
116
+ "// Generated by @sentry/nuxt.",
117
+ "// The Sentry server config is bundled into the server build and initializes automatically.",
118
+ "// This file only keeps existing `node --import ./.output/server/sentry.server.config.mjs` commands working.",
119
+ "console.warn('[Sentry] The `--import` flag for the Sentry server config is no longer needed and should be removed.');",
120
+ ""
121
+ ].join("\n");
122
+ try {
123
+ await fs.promises.writeFile(shimPath, contents, "utf8");
124
+ } catch (error) {
125
+ core.consoleSandbox(() => {
126
+ console.warn(`[Sentry] Could not write the \`--import\` compatibility shim to ${shimPath}`, error);
127
+ });
128
+ }
129
+ });
130
+ }
76
131
  function addDynamicImportEntryFileWrapper(nitro, serverConfigFile, moduleOptions) {
77
132
  if (!nitro.options.rollupConfig) {
78
133
  nitro.options.rollupConfig = { output: {} };
@@ -84,7 +139,8 @@ function addDynamicImportEntryFileWrapper(nitro, serverConfigFile, moduleOptions
84
139
  }
85
140
  nitro.options.rollupConfig.plugins.push(
86
141
  wrapEntryWithDynamicImport({
87
- resolvedSentryConfigPath: kit.createResolver(nitro.options.rootDir).resolve(`/${serverConfigFile}`),
142
+ resolvedSentryConfigPath: kit.createResolver(nitro.options.rootDir).resolve(serverConfigFile),
143
+ // oxlint-disable-next-line typescript/no-deprecated -- supported until removal
88
144
  experimental_entrypointWrappedFunctions: moduleOptions.experimental_entrypointWrappedFunctions
89
145
  })
90
146
  );
@@ -94,7 +150,7 @@ function injectServerConfigPlugin(nitro, serverConfigFile, isDebug) {
94
150
  return {
95
151
  name: "rollup-plugin-inject-sentry-server-config",
96
152
  buildStart() {
97
- const configPath = kit.createResolver(nitro.options.rootDir).resolve(`/${serverConfigFile}`);
153
+ const configPath = kit.createResolver(nitro.options.rootDir).resolve(serverConfigFile);
98
154
  if (!node_fs.existsSync(configPath)) {
99
155
  if (isDebug) {
100
156
  core.debug.log(`[Sentry] Sentry server config file not found: ${configPath}`);
@@ -110,7 +166,7 @@ function injectServerConfigPlugin(nitro, serverConfigFile, isDebug) {
110
166
  resolveId(source) {
111
167
  if (source.startsWith(filePrefix)) {
112
168
  const originalFilePath = source.replace(filePrefix, "");
113
- const configPath = kit.createResolver(nitro.options.rootDir).resolve(`/${originalFilePath}`);
169
+ const configPath = kit.createResolver(nitro.options.rootDir).resolve(originalFilePath);
114
170
  return { id: configPath };
115
171
  }
116
172
  return null;
@@ -126,11 +182,16 @@ function wrapEntryWithDynamicImport({
126
182
  return {
127
183
  name: "sentry-wrap-entry-with-dynamic-import",
128
184
  async resolveId(source, importer, options) {
129
- if (source.includes(`/${utils.SERVER_CONFIG_FILENAME}`)) {
130
- return { id: source, moduleSideEffects: true };
185
+ const resolvable = utils.toResolvablePath(source);
186
+ if (!resolvable) {
187
+ return null;
188
+ }
189
+ const { path: normalizedSource, wasFileUrl } = resolvable;
190
+ if (isServerConfigFile(normalizedSource, resolvedSentryConfigPath)) {
191
+ return { id: normalizedSource, moduleSideEffects: true };
131
192
  }
132
- if (options.isEntry && source.includes(".mjs") && !source.includes(`.mjs${utils.SENTRY_WRAPPED_ENTRY}`)) {
133
- const resolution = await this.resolve(source, importer, options);
193
+ if (options.isEntry && normalizedSource.includes(".mjs") && !normalizedSource.includes(`.mjs${utils.SENTRY_WRAPPED_ENTRY}`)) {
194
+ const resolution = await this.resolve(normalizedSource, importer, options);
134
195
  if (!resolution || resolution?.external) return resolution;
135
196
  const moduleInfo = await this.load(resolution);
136
197
  moduleInfo.moduleSideEffects = true;
@@ -142,16 +203,23 @@ function wrapEntryWithDynamicImport({
142
203
  )
143
204
  ).concat(utils.QUERY_END_INDICATOR)}`;
144
205
  }
206
+ if (wasFileUrl) {
207
+ const resolved = await this.resolve(normalizedSource, importer, { ...options, isEntry: false });
208
+ if (resolved) return resolved;
209
+ return { id: normalizedSource };
210
+ }
145
211
  return null;
146
212
  },
147
213
  load(id) {
148
214
  if (id.includes(`.mjs${utils.SENTRY_WRAPPED_ENTRY}`)) {
149
215
  const entryId = utils.removeSentryQueryFromPath(id).slice(resolutionIdPrefix.length);
150
- const reExportedFunctions = id.includes(utils.SENTRY_WRAPPED_FUNCTIONS) || id.includes(utils.SENTRY_REEXPORTED_FUNCTIONS) ? utils.constructFunctionReExport(id, entryId) : "";
216
+ const entryIdUrl = node_url.pathToFileURL(entryId).href;
217
+ const configUrl = node_url.pathToFileURL(resolvedSentryConfigPath).href;
218
+ const reExportedFunctions = id.includes(utils.SENTRY_WRAPPED_FUNCTIONS) || id.includes(utils.SENTRY_REEXPORTED_FUNCTIONS) ? utils.constructFunctionReExport(id, entryIdUrl) : "";
151
219
  return (
152
220
  // Regular `import` of the Sentry config
153
- `import ${JSON.stringify(resolvedSentryConfigPath)};
154
- import(${JSON.stringify(entryId)});
221
+ `import ${JSON.stringify(configUrl)};
222
+ import(${JSON.stringify(entryIdUrl)});
155
223
  ${reExportedFunctions}
156
224
  `
157
225
  );
@@ -161,9 +229,10 @@ ${reExportedFunctions}
161
229
  };
162
230
  }
163
231
 
164
- exports.DEV_SERVER_CONFIG_PATH = DEV_SERVER_CONFIG_PATH;
165
- exports.addDevServerConfigFile = addDevServerConfigFile;
166
232
  exports.addDynamicImportEntryFileWrapper = addDynamicImportEntryFileWrapper;
167
233
  exports.addSentryTopImport = addSentryTopImport;
234
+ exports.addServerConfigPlugin = addServerConfigPlugin;
235
+ exports.addServerConfigShimWithWarning = addServerConfigShimWithWarning;
168
236
  exports.addServerConfigToBuild = addServerConfigToBuild;
237
+ exports.wrapEntryWithDynamicImport = wrapEntryWithDynamicImport;
169
238
  //# sourceMappingURL=addServerConfig.js.map