@sentry/nuxt 9.0.0-alpha.1 → 9.0.0

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.
@@ -16,6 +16,10 @@ const module$1 = kit.defineNuxtModule({
16
16
  },
17
17
  defaults: {},
18
18
  setup(moduleOptionsParam, nuxt) {
19
+ if (moduleOptionsParam?.enabled === false) {
20
+ return;
21
+ }
22
+
19
23
  const moduleOptions = {
20
24
  ...moduleOptionsParam,
21
25
  autoInjectServerSentry: moduleOptionsParam.autoInjectServerSentry,
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../src/module.ts"],"sourcesContent":["import * as path from 'path';\nimport { addPlugin, addPluginTemplate, addServerPlugin, createResolver, defineNuxtModule } from '@nuxt/kit';\nimport { consoleSandbox } from '@sentry/core';\nimport type { SentryNuxtModuleOptions } from './common/types';\nimport { addDynamicImportEntryFileWrapper, addSentryTopImport, addServerConfigToBuild } from './vite/addServerConfig';\nimport { setupSourceMaps } from './vite/sourceMaps';\nimport { findDefaultSdkInitFile } from './vite/utils';\n\nexport type ModuleOptions = SentryNuxtModuleOptions;\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 setup(moduleOptionsParam, nuxt) {\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 = findDefaultSdkInitFile('client');\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\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 addPlugin({ src: moduleDirResolver.resolve('./runtime/plugins/sentry.client'), mode: 'client' });\n }\n\n const serverConfigFile = findDefaultSdkInitFile('server');\n\n if (serverConfigFile) {\n if (moduleOptions.autoInjectServerSentry !== 'experimental_dynamic-import') {\n addPluginTemplate({\n mode: 'server',\n filename: 'sentry-server-config.mjs',\n getContents: () =>\n // This won't actually import the server config in the build output (so no double init call). The import here is only needed for correctly resolving the Sentry release injection.\n `import \"${buildDirResolver.resolve(`/${serverConfigFile}`)}\";\n import { defineNuxtPlugin } from \"#imports\";\n export default defineNuxtPlugin(() => {});`,\n });\n }\n\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/sentry.server'));\n }\n\n if (clientConfigFile || serverConfigFile) {\n setupSourceMaps(moduleOptions, nuxt);\n }\n\n nuxt.hooks.hook('nitro:init', nitro => {\n if (serverConfigFile?.includes('.server.config')) {\n if (nitro.options.dev) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[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.',\n );\n });\n }\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 addServerConfigToBuild(moduleOptions, nuxt, nitro, serverConfigFile);\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 = `.${path.sep}${path.relative(nitro.options.rootDir, serverConfigPath)}`;\n\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Using your \\`${serverConfigFile}\\` file for the server-side Sentry configuration. Make sure to add the Node option \\`import\\` to the Node command where you deploy and/or run your application. This preloads the Sentry configuration at server startup. You can do this via a command-line flag (\\`node --import ${serverConfigRelativePath} [...]\\`) or via an environment variable (\\`NODE_OPTIONS='--import ${serverConfigRelativePath}' node [...]\\`).`,\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","addServerP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AA,GAAA;AACA,gBAAA,8HAAA;AACA,eAAA;AACA,aAAA,CAAA;AACA;AACA;AACA;AACA,KAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../src/module.ts"],"sourcesContent":["import * as path from 'path';\nimport { addPlugin, addPluginTemplate, addServerPlugin, createResolver, defineNuxtModule } from '@nuxt/kit';\nimport { consoleSandbox } from '@sentry/core';\nimport type { SentryNuxtModuleOptions } from './common/types';\nimport { addDynamicImportEntryFileWrapper, addSentryTopImport, addServerConfigToBuild } from './vite/addServerConfig';\nimport { setupSourceMaps } from './vite/sourceMaps';\nimport { findDefaultSdkInitFile } from './vite/utils';\n\nexport type ModuleOptions = SentryNuxtModuleOptions;\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 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 = findDefaultSdkInitFile('client');\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\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 addPlugin({ src: moduleDirResolver.resolve('./runtime/plugins/sentry.client'), mode: 'client' });\n }\n\n const serverConfigFile = findDefaultSdkInitFile('server');\n\n if (serverConfigFile) {\n if (moduleOptions.autoInjectServerSentry !== 'experimental_dynamic-import') {\n addPluginTemplate({\n mode: 'server',\n filename: 'sentry-server-config.mjs',\n getContents: () =>\n // This won't actually import the server config in the build output (so no double init call). The import here is only needed for correctly resolving the Sentry release injection.\n `import \"${buildDirResolver.resolve(`/${serverConfigFile}`)}\";\n import { defineNuxtPlugin } from \"#imports\";\n export default defineNuxtPlugin(() => {});`,\n });\n }\n\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/sentry.server'));\n }\n\n if (clientConfigFile || serverConfigFile) {\n setupSourceMaps(moduleOptions, nuxt);\n }\n\n nuxt.hooks.hook('nitro:init', nitro => {\n if (serverConfigFile?.includes('.server.config')) {\n if (nitro.options.dev) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[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.',\n );\n });\n }\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 addServerConfigToBuild(moduleOptions, nuxt, nitro, serverConfigFile);\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 = `.${path.sep}${path.relative(nitro.options.rootDir, serverConfigPath)}`;\n\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Using your \\`${serverConfigFile}\\` file for the server-side Sentry configuration. Make sure to add the Node option \\`import\\` to the Node command where you deploy and/or run your application. This preloads the Sentry configuration at server startup. You can do this via a command-line flag (\\`node --import ${serverConfigRelativePath} [...]\\`) or via an environment variable (\\`NODE_OPTIONS='--import ${serverConfigRelativePath}' node [...]\\`).`,\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","addServerPlugin","setupSourceMaps","consoleSandbox","addServerConfigToBuild","addSentryTopImport","addDynamicImportEntryFileWrapper"],"mappings":";;;;;;;;AAUA,iBAAeA,oBAAgB,CAAgB;AAC/C,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,qBAAqB;AAC/B,IAAI,SAAS,EAAE,QAAQ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-90,6 +90,12 @@ function getPluginOptions(
90
90
  telemetry: sourceMapsUploadOptions.telemetry ?? true,
91
91
  url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,
92
92
  debug: moduleOptions.debug ?? false,
93
+ silent: sourceMapsUploadOptions.silent ?? false,
94
+ errorHandler: sourceMapsUploadOptions.errorHandler,
95
+ release: {
96
+ name: sourceMapsUploadOptions.release?.name,
97
+ ...moduleOptions?.unstable_sentryBundlerPluginOptions?.release,
98
+ },
93
99
  _metaOptions: {
94
100
  telemetry: {
95
101
  metaFramework: 'nuxt',
@@ -1 +1 @@
1
- {"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { consoleSandbox } from '@sentry/core';\nimport { type SentryRollupPluginOptions, sentryRollupPlugin } from '@sentry/rollup-plugin';\nimport { type SentryVitePluginOptions, sentryVitePlugin } from '@sentry/vite-plugin';\nimport type { NitroConfig } from 'nitropack';\nimport type { OutputOptions } from 'rollup';\nimport type { SentryNuxtModuleOptions } from '../common/types';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(moduleOptions: SentryNuxtModuleOptions, nuxt: Nuxt): void {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n const sourceMapsEnabled = sourceMapsUploadOptions.enabled ?? true;\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev) {\n changeNuxtSourceMapSettings(nuxt, moduleOptions);\n }\n });\n\n nuxt.hook('vite:extendConfig', async (viteConfig, _env) => {\n if (sourceMapsEnabled && viteConfig.mode !== 'development') {\n const previousUserSourceMapSetting = changeViteSourceMapSettings(viteConfig, moduleOptions);\n\n // Add Sentry plugin\n viteConfig.plugins = viteConfig.plugins || [];\n viteConfig.plugins.push(\n sentryVitePlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),\n );\n }\n });\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev) {\n if (!nitroConfig.rollupConfig) {\n nitroConfig.rollupConfig = {};\n }\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n const previousUserSourceMapSetting = changeRollupSourceMapSettings(nitroConfig, moduleOptions);\n\n // Add Sentry plugin\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),\n );\n }\n });\n}\n\n/**\n * Normalizes the beginning of a path from e.g. ../../../ to ./\n */\nfunction normalizePath(path: string): string {\n return path.replace(/^(\\.\\.\\/)+/, './');\n}\n\n/**\n * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n deleteFilesAfterUpload: boolean,\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n\n if (typeof sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload === 'undefined' && deleteFilesAfterUpload) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Setting `sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [\".*/**/public/**/*.map\"]` to delete generated source maps after they were uploaded to Sentry.',\n );\n });\n }\n\n return {\n org: sourceMapsUploadOptions.org ?? process.env.SENTRY_ORG,\n project: sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,\n authToken: sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n telemetry: sourceMapsUploadOptions.telemetry ?? true,\n url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,\n debug: moduleOptions.debug ?? false,\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n ...moduleOptions?.unstable_sentryBundlerPluginOptions,\n\n sourcemaps: {\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n assets: sourceMapsUploadOptions.sourcemaps?.assets ?? undefined,\n ignore: sourceMapsUploadOptions.sourcemaps?.ignore ?? undefined,\n filesToDeleteAfterUpload: sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n ? sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n : deleteFilesAfterUpload\n ? ['.*/**/public/**/*.map']\n : undefined,\n rewriteSources: (source: string) => normalizePath(source),\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,\n },\n };\n}\n\n/* There are 3 ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Nuxt has 3 places to set source maps: vite options, rollup options, nuxt itself\n Ideally, all 3 are enabled to get all source maps.\n */\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options = nuxt.options || {};\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap');\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client');\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server');\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** only exported for testing */\nexport function changeViteSourceMapSettings(\n viteConfig: { build?: { sourcemap?: boolean | 'inline' | 'hidden' } },\n sentryModuleOptions: SentryNuxtModuleOptions,\n): UserSourceMapSetting {\n viteConfig.build = viteConfig.build || {};\n const viteSourceMap = viteConfig.build.sourcemap;\n\n let previousUserSourceMapSetting: UserSourceMapSetting;\n\n if (viteSourceMap === false) {\n warnExplicitlyDisabledSourceMap('vite.build.sourcemap');\n previousUserSourceMapSetting = 'disabled';\n } else if (viteSourceMap && ['hidden', 'inline', true].includes(viteSourceMap)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'vite.build.sourcemap', viteSourceMap.toString());\n previousUserSourceMapSetting = 'enabled';\n } else {\n viteConfig.build.sourcemap = 'hidden';\n logSentryEnablesSourceMap('vite.build.sourcemap', 'hidden');\n previousUserSourceMapSetting = 'unset';\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** only exported for testing */\nexport function changeRollupSourceMapSettings(\n nitroConfig: {\n rollupConfig?: {\n output?: {\n sourcemap?: OutputOptions['sourcemap'];\n sourcemapExcludeSources?: OutputOptions['sourcemapExcludeSources'];\n };\n };\n },\n sentryModuleOptions: SentryNuxtModuleOptions,\n): UserSourceMapSetting {\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n\n let previousUserSourceMapSetting: UserSourceMapSetting;\n\n const nitroSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n if (nitroSourceMap === false) {\n warnExplicitlyDisabledSourceMap('nitro.rollupConfig.output.sourcemap');\n previousUserSourceMapSetting = 'disabled';\n } else if (nitroSourceMap && ['hidden', 'inline', true].includes(nitroSourceMap)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'nitro.rollupConfig.output.sourcemap', nitroSourceMap.toString());\n previousUserSourceMapSetting = 'enabled';\n } else {\n nitroConfig.rollupConfig.output.sourcemap = 'hidden';\n logSentryEnablesSourceMap('nitro.rollupConfig.output.sourcemap', 'hidden');\n previousUserSourceMapSetting = 'unset';\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Disabled source map setting in the Nuxt config: `nitro.rollupConfig.output.sourcemapExcludeSources`. Source maps will include the actual code to be able to un-minify code snippets in Sentry.',\n );\n });\n\n return previousUserSourceMapSetting;\n}\n\nfunction logKeepSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We discovered \\`${settingKey}\\` is set to \\`${settingValue}\\`. Sentry will keep this source map setting. This will un-minify the code snippet on the Sentry Issue page.`,\n );\n });\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Parts of source map generation are currently disabled in your Nuxt configuration (\\`${settingKey}: false\\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n });\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n });\n}\n"],"names":["sentryVitePlugin","sentryRollupPlugin","consoleSandbox"],"mappings":";;;;;;AAQA;AACA;AACA;;AAGA;AACA;AACA;AACO,SAAS,eAAe,CAAC,a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C9E,IAAI,4BAAA,GAA+B,OAAO;AAC1C;;AAEA,EAAE,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAA,GAA0B,KAAK;AACjE,EAAEA,mBAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,GAAG;AACf,MAAM,yMAAyM;AAC/M,KAAK;AACL,GAAG,CAAC;;AAEJ,EAAE,OAAO,4BAA4B;AACrC;;AAEA,SAAS,uBAAuB;AAChC,EAAE,uBAAuB;AACzB,EAAE,UAAU;AACZ,EAAE,YAAY;AACd,EAAQ;AACR,EAAE,IAAI,uBAAuB,CAAC,KAAK,EAAE;AACrC,IAAIA,mBAAc,CAAC,MAAM;AACzB;AACA,MAAM,OAAO,CAAC,GAAG;AACjB,QAAQ,CAAC,yBAAyB,EAAE,UAAU,CAAC,eAAe,EAAE,YAAY,CAAC,4GAA4G,CAAC;AAC1L,OAAO;AACP,KAAK,CAAC;AACN;AACA;;AAEA,SAAS,+BAA+B,CAAC,UAAU,EAAgB;AACnE,EAAEA,mBAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,IAAI;AAChB,MAAM,CAAC,6FAA6F,EAAE,UAAU,CAAC,0QAA0Q,EAAE,UAAU,CAAC,wCAAwC,CAAC;AACjb,KAAK;AACL,GAAG,CAAC;AACJ;;AAEA,SAAS,yBAAyB,CAAC,UAAU,EAAU,YAAY,EAAgB;AACnF,EAAEA,mBAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,mEAAmE,EAAE,UAAU,CAAC,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;AACvH,GAAG,CAAC;AACJ;;;;;;;;"}
1
+ {"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { consoleSandbox } from '@sentry/core';\nimport { type SentryRollupPluginOptions, sentryRollupPlugin } from '@sentry/rollup-plugin';\nimport { type SentryVitePluginOptions, sentryVitePlugin } from '@sentry/vite-plugin';\nimport type { NitroConfig } from 'nitropack';\nimport type { OutputOptions } from 'rollup';\nimport type { SentryNuxtModuleOptions } from '../common/types';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(moduleOptions: SentryNuxtModuleOptions, nuxt: Nuxt): void {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n const sourceMapsEnabled = sourceMapsUploadOptions.enabled ?? true;\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev) {\n changeNuxtSourceMapSettings(nuxt, moduleOptions);\n }\n });\n\n nuxt.hook('vite:extendConfig', async (viteConfig, _env) => {\n if (sourceMapsEnabled && viteConfig.mode !== 'development') {\n const previousUserSourceMapSetting = changeViteSourceMapSettings(viteConfig, moduleOptions);\n\n // Add Sentry plugin\n viteConfig.plugins = viteConfig.plugins || [];\n viteConfig.plugins.push(\n sentryVitePlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),\n );\n }\n });\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev) {\n if (!nitroConfig.rollupConfig) {\n nitroConfig.rollupConfig = {};\n }\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n const previousUserSourceMapSetting = changeRollupSourceMapSettings(nitroConfig, moduleOptions);\n\n // Add Sentry plugin\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),\n );\n }\n });\n}\n\n/**\n * Normalizes the beginning of a path from e.g. ../../../ to ./\n */\nfunction normalizePath(path: string): string {\n return path.replace(/^(\\.\\.\\/)+/, './');\n}\n\n/**\n * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n deleteFilesAfterUpload: boolean,\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n\n if (typeof sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload === 'undefined' && deleteFilesAfterUpload) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Setting `sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [\".*/**/public/**/*.map\"]` to delete generated source maps after they were uploaded to Sentry.',\n );\n });\n }\n\n return {\n org: sourceMapsUploadOptions.org ?? process.env.SENTRY_ORG,\n project: sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,\n authToken: sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n telemetry: sourceMapsUploadOptions.telemetry ?? true,\n url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,\n debug: moduleOptions.debug ?? false,\n silent: sourceMapsUploadOptions.silent ?? false,\n errorHandler: sourceMapsUploadOptions.errorHandler,\n release: {\n name: sourceMapsUploadOptions.release?.name,\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.release,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n ...moduleOptions?.unstable_sentryBundlerPluginOptions,\n\n sourcemaps: {\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n assets: sourceMapsUploadOptions.sourcemaps?.assets ?? undefined,\n ignore: sourceMapsUploadOptions.sourcemaps?.ignore ?? undefined,\n filesToDeleteAfterUpload: sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n ? sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n : deleteFilesAfterUpload\n ? ['.*/**/public/**/*.map']\n : undefined,\n rewriteSources: (source: string) => normalizePath(source),\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,\n },\n };\n}\n\n/* There are 3 ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Nuxt has 3 places to set source maps: vite options, rollup options, nuxt itself\n Ideally, all 3 are enabled to get all source maps.\n */\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options = nuxt.options || {};\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap');\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client');\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server');\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** only exported for testing */\nexport function changeViteSourceMapSettings(\n viteConfig: { build?: { sourcemap?: boolean | 'inline' | 'hidden' } },\n sentryModuleOptions: SentryNuxtModuleOptions,\n): UserSourceMapSetting {\n viteConfig.build = viteConfig.build || {};\n const viteSourceMap = viteConfig.build.sourcemap;\n\n let previousUserSourceMapSetting: UserSourceMapSetting;\n\n if (viteSourceMap === false) {\n warnExplicitlyDisabledSourceMap('vite.build.sourcemap');\n previousUserSourceMapSetting = 'disabled';\n } else if (viteSourceMap && ['hidden', 'inline', true].includes(viteSourceMap)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'vite.build.sourcemap', viteSourceMap.toString());\n previousUserSourceMapSetting = 'enabled';\n } else {\n viteConfig.build.sourcemap = 'hidden';\n logSentryEnablesSourceMap('vite.build.sourcemap', 'hidden');\n previousUserSourceMapSetting = 'unset';\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** only exported for testing */\nexport function changeRollupSourceMapSettings(\n nitroConfig: {\n rollupConfig?: {\n output?: {\n sourcemap?: OutputOptions['sourcemap'];\n sourcemapExcludeSources?: OutputOptions['sourcemapExcludeSources'];\n };\n };\n },\n sentryModuleOptions: SentryNuxtModuleOptions,\n): UserSourceMapSetting {\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n\n let previousUserSourceMapSetting: UserSourceMapSetting;\n\n const nitroSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n if (nitroSourceMap === false) {\n warnExplicitlyDisabledSourceMap('nitro.rollupConfig.output.sourcemap');\n previousUserSourceMapSetting = 'disabled';\n } else if (nitroSourceMap && ['hidden', 'inline', true].includes(nitroSourceMap)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'nitro.rollupConfig.output.sourcemap', nitroSourceMap.toString());\n previousUserSourceMapSetting = 'enabled';\n } else {\n nitroConfig.rollupConfig.output.sourcemap = 'hidden';\n logSentryEnablesSourceMap('nitro.rollupConfig.output.sourcemap', 'hidden');\n previousUserSourceMapSetting = 'unset';\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Disabled source map setting in the Nuxt config: `nitro.rollupConfig.output.sourcemapExcludeSources`. Source maps will include the actual code to be able to un-minify code snippets in Sentry.',\n );\n });\n\n return previousUserSourceMapSetting;\n}\n\nfunction logKeepSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We discovered \\`${settingKey}\\` is set to \\`${settingValue}\\`. Sentry will keep this source map setting. This will un-minify the code snippet on the Sentry Issue page.`,\n );\n });\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Parts of source map generation are currently disabled in your Nuxt configuration (\\`${settingKey}: false\\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n });\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n });\n}\n"],"names":["sentryVitePlugin","sentryRollupPlugin","consoleSandbox"],"mappings":";;;;;;AAQA;AACA;AACA;;AAGA;AACA;AACA;AACO,SAAS,eAAe,CAAC,aAAa,EAA2B,IAAI,EAAc;AAC1F,EAAE,MAAM,0BAA0B,aAAa,CAAC,uBAAwB,IAAG,EAAE;AAC7E,EAAE,MAAM,iBAAkB,GAAE,uBAAuB,CAAC,OAAA,IAAW,IAAI;;AAEnE,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM;AAClC,IAAI,IAAI,iBAAA,IAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAChD,MAAM,2BAA2B,CAAC,IAAI,EAAE,aAAa,CAAC;AACtD;AACA,GAAG,CAAC;;AAEJ,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OA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,GAAG;AACf,MAAM,yMAAyM;AAC/M,KAAK;AACL,GAAG,CAAC;;AAEJ,EAAE,OAAO,4BAA4B;AACrC;;AAEA,SAAS,uBAAuB;AAChC,EAAE,uBAAuB;AACzB,EAAE,UAAU;AACZ,EAAE,YAAY;AACd,EAAQ;AACR,EAAE,IAAI,uBAAuB,CAAC,KAAK,EAAE;AACrC,IAAIA,mBAAc,CAAC,MAAM;AACzB;AACA,MAAM,OAAO,CAAC,GAAG;AACjB,QAAQ,CAAC,yBAAyB,EAAE,UAAU,CAAC,eAAe,EAAE,YAAY,CAAC,4GAA4G,CAAC;AAC1L,OAAO;AACP,KAAK,CAAC;AACN;AACA;;AAEA,SAAS,+BAA+B,CAAC,UAAU,EAAgB;AACnE,EAAEA,mBAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,IAAI;AAChB,MAAM,CAAC,6FAA6F,EAAE,UAAU,CAAC,0QAA0Q,EAAE,UAAU,CAAC,wCAAwC,CAAC;AACjb,KAAK;AACL,GAAG,CAAC;AACJ;;AAEA,SAAS,yBAAyB,CAAC,UAAU,EAAU,YAAY,EAAgB;AACnF,EAAEA,mBAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,mEAAmE,EAAE,UAAU,CAAC,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;AACvH,GAAG,CAAC;AACJ;;;;;;;;"}
@@ -15,6 +15,10 @@ const module = defineNuxtModule({
15
15
  },
16
16
  defaults: {},
17
17
  setup(moduleOptionsParam, nuxt) {
18
+ if (moduleOptionsParam?.enabled === false) {
19
+ return;
20
+ }
21
+
18
22
  const moduleOptions = {
19
23
  ...moduleOptionsParam,
20
24
  autoInjectServerSentry: moduleOptionsParam.autoInjectServerSentry,
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../src/module.ts"],"sourcesContent":["import * as path from 'path';\nimport { addPlugin, addPluginTemplate, addServerPlugin, createResolver, defineNuxtModule } from '@nuxt/kit';\nimport { consoleSandbox } from '@sentry/core';\nimport type { SentryNuxtModuleOptions } from './common/types';\nimport { addDynamicImportEntryFileWrapper, addSentryTopImport, addServerConfigToBuild } from './vite/addServerConfig';\nimport { setupSourceMaps } from './vite/sourceMaps';\nimport { findDefaultSdkInitFile } from './vite/utils';\n\nexport type ModuleOptions = SentryNuxtModuleOptions;\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 setup(moduleOptionsParam, nuxt) {\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 = findDefaultSdkInitFile('client');\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\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 addPlugin({ src: moduleDirResolver.resolve('./runtime/plugins/sentry.client'), mode: 'client' });\n }\n\n const serverConfigFile = findDefaultSdkInitFile('server');\n\n if (serverConfigFile) {\n if (moduleOptions.autoInjectServerSentry !== 'experimental_dynamic-import') {\n addPluginTemplate({\n mode: 'server',\n filename: 'sentry-server-config.mjs',\n getContents: () =>\n // This won't actually import the server config in the build output (so no double init call). The import here is only needed for correctly resolving the Sentry release injection.\n `import \"${buildDirResolver.resolve(`/${serverConfigFile}`)}\";\n import { defineNuxtPlugin } from \"#imports\";\n export default defineNuxtPlugin(() => {});`,\n });\n }\n\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/sentry.server'));\n }\n\n if (clientConfigFile || serverConfigFile) {\n setupSourceMaps(moduleOptions, nuxt);\n }\n\n nuxt.hooks.hook('nitro:init', nitro => {\n if (serverConfigFile?.includes('.server.config')) {\n if (nitro.options.dev) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[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.',\n );\n });\n }\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 addServerConfigToBuild(moduleOptions, nuxt, nitro, serverConfigFile);\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 = `.${path.sep}${path.relative(nitro.options.rootDir, serverConfigPath)}`;\n\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Using your \\`${serverConfigFile}\\` file for the server-side Sentry configuration. Make sure to add the Node option \\`import\\` to the Node command where you deploy and/or run your application. This preloads the Sentry configuration at server startup. You can do this via a command-line flag (\\`node --import ${serverConfigRelativePath} [...]\\`) or via an environment variable (\\`NODE_OPTIONS='--import ${serverConfigRelativePath}' node [...]\\`).`,\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":[],"mappings":";;;;;;;AAUA,eAAe,gBAAgB,CAAgB;AAC/C,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,qBAAqB;AAC/B,IAAI,SAAS,EAAE,QAAQ;AACvB,IAAI,aAAa,EAAE;AACnB,MAAM,IAAI,EAAE,SAAS;AACrB,KAAK;AACL,GAAG;AACH,EAAE,QAAQ,EAAE,EAAE;AACd,EAAE,KAAK,CAAC,kBAAkB,EAAE,IAAI,EAAE;AAClC,IAAI,MAAM,gBAAgB;AAC1B,MAAM,GAAG,kBAAkB;AAC3B,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,sBAAsB;AACvE,MAAM,uCAAuC,EAAE,kBAAkB,CAAC,2CAA2C;AAC7G,QAAQ,SAAS;AACjB,QAAQ,SAAS;AACjB,QAAQ,QAAQ;AAChB,OAAO;AACP,KAAK;;AAE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,CAAA,QAAA,CAAA,KAAA,CAAA,OAAA,CAAA,OAAA,EAAA,gBAAA,CAAA,CAAA,CAAA;;AAEA,YAAA,cAAA,CAAA,MAAA;AACA;AACA,cAAA,OAAA,CAAA,GAAA;AACA,gBAAA,CAAA,sBAAA,EAAA,gBAAA,CAAA,mRAAA,EAAA,wBAAA,CAAA,mEAAA,EAAA,wBAAA,CAAA,gBAAA,CAAA;AACA,eAAA;AACA,aAAA,CAAA;AACA;AACA;;AAEA,QAAA,IAAA,aAAA,CAAA,sBAAA,KAAA,kBAAA,EAAA;AACA,UAAA,kBAAA,CAAA,aAAA,EAAA,KAAA,CAAA;AACA;;AAEA,QAAA,IAAA,aAAA,CAAA,sBAAA,KAAA,6BAAA,EAAA;AACA,UAAA,gCAAA,CAAA,KAAA,EAAA,gBAAA,EAAA,aAAA,CAAA;;AAEA,UAAA,IAAA,aAAA,CAAA,KAAA,EAAA;AACA,YAAA,cAAA,CAAA,MAAA;AACA;AACA,cAAA,OAAA,CAAA,GAAA;AACA,gBAAA,8HAAA;AACA,eAAA;AACA,aAAA,CAAA;AACA;AACA;AACA;AACA,KAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../src/module.ts"],"sourcesContent":["import * as path from 'path';\nimport { addPlugin, addPluginTemplate, addServerPlugin, createResolver, defineNuxtModule } from '@nuxt/kit';\nimport { consoleSandbox } from '@sentry/core';\nimport type { SentryNuxtModuleOptions } from './common/types';\nimport { addDynamicImportEntryFileWrapper, addSentryTopImport, addServerConfigToBuild } from './vite/addServerConfig';\nimport { setupSourceMaps } from './vite/sourceMaps';\nimport { findDefaultSdkInitFile } from './vite/utils';\n\nexport type ModuleOptions = SentryNuxtModuleOptions;\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 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 = findDefaultSdkInitFile('client');\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\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 addPlugin({ src: moduleDirResolver.resolve('./runtime/plugins/sentry.client'), mode: 'client' });\n }\n\n const serverConfigFile = findDefaultSdkInitFile('server');\n\n if (serverConfigFile) {\n if (moduleOptions.autoInjectServerSentry !== 'experimental_dynamic-import') {\n addPluginTemplate({\n mode: 'server',\n filename: 'sentry-server-config.mjs',\n getContents: () =>\n // This won't actually import the server config in the build output (so no double init call). The import here is only needed for correctly resolving the Sentry release injection.\n `import \"${buildDirResolver.resolve(`/${serverConfigFile}`)}\";\n import { defineNuxtPlugin } from \"#imports\";\n export default defineNuxtPlugin(() => {});`,\n });\n }\n\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/sentry.server'));\n }\n\n if (clientConfigFile || serverConfigFile) {\n setupSourceMaps(moduleOptions, nuxt);\n }\n\n nuxt.hooks.hook('nitro:init', nitro => {\n if (serverConfigFile?.includes('.server.config')) {\n if (nitro.options.dev) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[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.',\n );\n });\n }\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 addServerConfigToBuild(moduleOptions, nuxt, nitro, serverConfigFile);\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 = `.${path.sep}${path.relative(nitro.options.rootDir, serverConfigPath)}`;\n\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Using your \\`${serverConfigFile}\\` file for the server-side Sentry configuration. Make sure to add the Node option \\`import\\` to the Node command where you deploy and/or run your application. This preloads the Sentry configuration at server startup. You can do this via a command-line flag (\\`node --import ${serverConfigRelativePath} [...]\\`) or via an environment variable (\\`NODE_OPTIONS='--import ${serverConfigRelativePath}' node [...]\\`).`,\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":[],"mappings":";;;;;;;AAUA,eAAe,gBAAgB,CAAgB;AAC/C,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,qBAAqB;AAC/B,IAAI,SAAS,EAAE,QAAQ;AACvB,IAAI,aAAa,EAAE;AACnB,MAAM,IAAI,EAAE,SAAS;AACrB,KAAK;AACL,GAAG;AACH,EAAE,QAAQ,EAAE,EAAE;AACd,EAAE,KAAK,CAAC,kBAAkB,EAAE,IAAI,EAAE;AAClC,IAAI,IAAI,kBAAkB,EAAE,OAAQ,KAAI,KAAK,EAAE;AAC/C,MAAM;AACN;;AAEA,IAAI,MAAM,gBAAgB;AAC1B,MAAM,GAAG,kBAAkB;AAC3B,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,sBAAsB;AACvE,MAAM,uCAAuC,EAAE,kBAAkB,CAAC,2CAA2C;AAC7G,QAAQ,SAAS;AACjB,QAAQ,SAAS;AACjB,QAAQ,QAAQ;AAChB,OAAO;AACP,KAAK;;AAEL,IAAI,MAAM,iBAAkB,GAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AAC7D,IAAI,MAAM,gBAAiB,GAAE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;;AAElE,IAAI,MAAM,gBAAiB,GAAE,sBAAsB,CAAC,QAAQ,CAAC;;AAE7D,IAAI,IAAI,gBAAgB,EAAE;AAC1B;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AA;AACA,aAAA,CAAA;AACA;AACA;;AAEA,QAAA,IAAA,aAAA,CAAA,sBAAA,KAAA,kBAAA,EAAA;AACA,UAAA,kBAAA,CAAA,aAAA,EAAA,KAAA,CAAA;AACA;;AAEA,QAAA,IAAA,aAAA,CAAA,sBAAA,KAAA,6BAAA,EAAA;AACA,UAAA,gCAAA,CAAA,KAAA,EAAA,gBAAA,EAAA,aAAA,CAAA;;AAEA,UAAA,IAAA,aAAA,CAAA,KAAA,EAAA;AACA,YAAA,cAAA,CAAA,MAAA;AACA;AACA,cAAA,OAAA,CAAA,GAAA;AACA,gBAAA,8HAAA;AACA,eAAA;AACA,aAAA,CAAA;AACA;AACA;AACA;AACA,KAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"9.0.0-alpha.1"}
1
+ {"type":"module","version":"9.0.0"}
@@ -88,6 +88,12 @@ function getPluginOptions(
88
88
  telemetry: sourceMapsUploadOptions.telemetry ?? true,
89
89
  url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,
90
90
  debug: moduleOptions.debug ?? false,
91
+ silent: sourceMapsUploadOptions.silent ?? false,
92
+ errorHandler: sourceMapsUploadOptions.errorHandler,
93
+ release: {
94
+ name: sourceMapsUploadOptions.release?.name,
95
+ ...moduleOptions?.unstable_sentryBundlerPluginOptions?.release,
96
+ },
91
97
  _metaOptions: {
92
98
  telemetry: {
93
99
  metaFramework: 'nuxt',
@@ -1 +1 @@
1
- {"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { consoleSandbox } from '@sentry/core';\nimport { type SentryRollupPluginOptions, sentryRollupPlugin } from '@sentry/rollup-plugin';\nimport { type SentryVitePluginOptions, sentryVitePlugin } from '@sentry/vite-plugin';\nimport type { NitroConfig } from 'nitropack';\nimport type { OutputOptions } from 'rollup';\nimport type { SentryNuxtModuleOptions } from '../common/types';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(moduleOptions: SentryNuxtModuleOptions, nuxt: Nuxt): void {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n const sourceMapsEnabled = sourceMapsUploadOptions.enabled ?? true;\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev) {\n changeNuxtSourceMapSettings(nuxt, moduleOptions);\n }\n });\n\n nuxt.hook('vite:extendConfig', async (viteConfig, _env) => {\n if (sourceMapsEnabled && viteConfig.mode !== 'development') {\n const previousUserSourceMapSetting = changeViteSourceMapSettings(viteConfig, moduleOptions);\n\n // Add Sentry plugin\n viteConfig.plugins = viteConfig.plugins || [];\n viteConfig.plugins.push(\n sentryVitePlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),\n );\n }\n });\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev) {\n if (!nitroConfig.rollupConfig) {\n nitroConfig.rollupConfig = {};\n }\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n const previousUserSourceMapSetting = changeRollupSourceMapSettings(nitroConfig, moduleOptions);\n\n // Add Sentry plugin\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),\n );\n }\n });\n}\n\n/**\n * Normalizes the beginning of a path from e.g. ../../../ to ./\n */\nfunction normalizePath(path: string): string {\n return path.replace(/^(\\.\\.\\/)+/, './');\n}\n\n/**\n * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n deleteFilesAfterUpload: boolean,\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n\n if (typeof sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload === 'undefined' && deleteFilesAfterUpload) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Setting `sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [\".*/**/public/**/*.map\"]` to delete generated source maps after they were uploaded to Sentry.',\n );\n });\n }\n\n return {\n org: sourceMapsUploadOptions.org ?? process.env.SENTRY_ORG,\n project: sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,\n authToken: sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n telemetry: sourceMapsUploadOptions.telemetry ?? true,\n url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,\n debug: moduleOptions.debug ?? false,\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n ...moduleOptions?.unstable_sentryBundlerPluginOptions,\n\n sourcemaps: {\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n assets: sourceMapsUploadOptions.sourcemaps?.assets ?? undefined,\n ignore: sourceMapsUploadOptions.sourcemaps?.ignore ?? undefined,\n filesToDeleteAfterUpload: sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n ? sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n : deleteFilesAfterUpload\n ? ['.*/**/public/**/*.map']\n : undefined,\n rewriteSources: (source: string) => normalizePath(source),\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,\n },\n };\n}\n\n/* There are 3 ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Nuxt has 3 places to set source maps: vite options, rollup options, nuxt itself\n Ideally, all 3 are enabled to get all source maps.\n */\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options = nuxt.options || {};\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap');\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client');\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server');\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** only exported for testing */\nexport function changeViteSourceMapSettings(\n viteConfig: { build?: { sourcemap?: boolean | 'inline' | 'hidden' } },\n sentryModuleOptions: SentryNuxtModuleOptions,\n): UserSourceMapSetting {\n viteConfig.build = viteConfig.build || {};\n const viteSourceMap = viteConfig.build.sourcemap;\n\n let previousUserSourceMapSetting: UserSourceMapSetting;\n\n if (viteSourceMap === false) {\n warnExplicitlyDisabledSourceMap('vite.build.sourcemap');\n previousUserSourceMapSetting = 'disabled';\n } else if (viteSourceMap && ['hidden', 'inline', true].includes(viteSourceMap)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'vite.build.sourcemap', viteSourceMap.toString());\n previousUserSourceMapSetting = 'enabled';\n } else {\n viteConfig.build.sourcemap = 'hidden';\n logSentryEnablesSourceMap('vite.build.sourcemap', 'hidden');\n previousUserSourceMapSetting = 'unset';\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** only exported for testing */\nexport function changeRollupSourceMapSettings(\n nitroConfig: {\n rollupConfig?: {\n output?: {\n sourcemap?: OutputOptions['sourcemap'];\n sourcemapExcludeSources?: OutputOptions['sourcemapExcludeSources'];\n };\n };\n },\n sentryModuleOptions: SentryNuxtModuleOptions,\n): UserSourceMapSetting {\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n\n let previousUserSourceMapSetting: UserSourceMapSetting;\n\n const nitroSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n if (nitroSourceMap === false) {\n warnExplicitlyDisabledSourceMap('nitro.rollupConfig.output.sourcemap');\n previousUserSourceMapSetting = 'disabled';\n } else if (nitroSourceMap && ['hidden', 'inline', true].includes(nitroSourceMap)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'nitro.rollupConfig.output.sourcemap', nitroSourceMap.toString());\n previousUserSourceMapSetting = 'enabled';\n } else {\n nitroConfig.rollupConfig.output.sourcemap = 'hidden';\n logSentryEnablesSourceMap('nitro.rollupConfig.output.sourcemap', 'hidden');\n previousUserSourceMapSetting = 'unset';\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Disabled source map setting in the Nuxt config: `nitro.rollupConfig.output.sourcemapExcludeSources`. Source maps will include the actual code to be able to un-minify code snippets in Sentry.',\n );\n });\n\n return previousUserSourceMapSetting;\n}\n\nfunction logKeepSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We discovered \\`${settingKey}\\` is set to \\`${settingValue}\\`. Sentry will keep this source map setting. This will un-minify the code snippet on the Sentry Issue page.`,\n );\n });\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Parts of source map generation are currently disabled in your Nuxt configuration (\\`${settingKey}: false\\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n });\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n });\n}\n"],"names":[],"mappings":";;;;AAQA;AACA;AACA;;AAGA;AACA;AACA;AACO,SAAS,eAAe,CAAC,aAAa,EAA2B,IAAI,EAAc;AAC1F,EAAE,MAAM,0BAA0B,aAAa,CAAC,uBAAwB,IAAG,EAAE;AAC7E,EAAE,MAAM,iBAAkB,GAAE,uBAAuB,CAAC,OAAA,IAAW,IAAI;;AAEnE,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM;AAClC,IAAI,IAAI,iBAAA,IAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAChD,MAAM,2BAA2B,CAAC,IAAI,EAAE,aAAa,CAAC;AACtD;AACA,GAAG,CAAC;;AAEJ,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,UAAU,EAAE,IAAI,KAAK;AAC7D,IAAI,IAAI,iBAAkB,IAAG,UAAU,CAAC,IAAA,KAAS,aAAa,EAAE;AAChE,MAAM,MAAM,+BAA+B,2BAA2B,CAAC,UAAU,EAAE,aAAa,CAAC;;AAEjG;AACA,MAAM,UAAU,CAAC,OAAQ,GAAE,UAAU,CAAC,OAAA,IAAW,EAAE;AACnD,MAAM,UAAU,CAAC,OAAO,CAAC,IAAI;AAC7B,QAAQ,gBAAgB,C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E,UAAU,CAAC,0QAA0Q,EAAE,UAAU,CAAC,wCAAwC,CAAC;AACjb,KAAK;AACL,GAAG,CAAC;AACJ;;AAEA,SAAS,yBAAyB,CAAC,UAAU,EAAU,YAAY,EAAgB;AACnF,EAAE,cAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,mEAAmE,EAAE,UAAU,CAAC,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;AACvH,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { consoleSandbox } from '@sentry/core';\nimport { type SentryRollupPluginOptions, sentryRollupPlugin } from '@sentry/rollup-plugin';\nimport { type SentryVitePluginOptions, sentryVitePlugin } from '@sentry/vite-plugin';\nimport type { NitroConfig } from 'nitropack';\nimport type { OutputOptions } from 'rollup';\nimport type { SentryNuxtModuleOptions } from '../common/types';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(moduleOptions: SentryNuxtModuleOptions, nuxt: Nuxt): void {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n const sourceMapsEnabled = sourceMapsUploadOptions.enabled ?? true;\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev) {\n changeNuxtSourceMapSettings(nuxt, moduleOptions);\n }\n });\n\n nuxt.hook('vite:extendConfig', async (viteConfig, _env) => {\n if (sourceMapsEnabled && viteConfig.mode !== 'development') {\n const previousUserSourceMapSetting = changeViteSourceMapSettings(viteConfig, moduleOptions);\n\n // Add Sentry plugin\n viteConfig.plugins = viteConfig.plugins || [];\n viteConfig.plugins.push(\n sentryVitePlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),\n );\n }\n });\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev) {\n if (!nitroConfig.rollupConfig) {\n nitroConfig.rollupConfig = {};\n }\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n const previousUserSourceMapSetting = changeRollupSourceMapSettings(nitroConfig, moduleOptions);\n\n // Add Sentry plugin\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(getPluginOptions(moduleOptions, previousUserSourceMapSetting === 'unset')),\n );\n }\n });\n}\n\n/**\n * Normalizes the beginning of a path from e.g. ../../../ to ./\n */\nfunction normalizePath(path: string): string {\n return path.replace(/^(\\.\\.\\/)+/, './');\n}\n\n/**\n * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n deleteFilesAfterUpload: boolean,\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n\n if (typeof sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload === 'undefined' && deleteFilesAfterUpload) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Setting `sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [\".*/**/public/**/*.map\"]` to delete generated source maps after they were uploaded to Sentry.',\n );\n });\n }\n\n return {\n org: sourceMapsUploadOptions.org ?? process.env.SENTRY_ORG,\n project: sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,\n authToken: sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n telemetry: sourceMapsUploadOptions.telemetry ?? true,\n url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,\n debug: moduleOptions.debug ?? false,\n silent: sourceMapsUploadOptions.silent ?? false,\n errorHandler: sourceMapsUploadOptions.errorHandler,\n release: {\n name: sourceMapsUploadOptions.release?.name,\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.release,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n ...moduleOptions?.unstable_sentryBundlerPluginOptions,\n\n sourcemaps: {\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n assets: sourceMapsUploadOptions.sourcemaps?.assets ?? undefined,\n ignore: sourceMapsUploadOptions.sourcemaps?.ignore ?? undefined,\n filesToDeleteAfterUpload: sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n ? sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n : deleteFilesAfterUpload\n ? ['.*/**/public/**/*.map']\n : undefined,\n rewriteSources: (source: string) => normalizePath(source),\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,\n },\n };\n}\n\n/* There are 3 ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Nuxt has 3 places to set source maps: vite options, rollup options, nuxt itself\n Ideally, all 3 are enabled to get all source maps.\n */\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options = nuxt.options || {};\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap');\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client');\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server');\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** only exported for testing */\nexport function changeViteSourceMapSettings(\n viteConfig: { build?: { sourcemap?: boolean | 'inline' | 'hidden' } },\n sentryModuleOptions: SentryNuxtModuleOptions,\n): UserSourceMapSetting {\n viteConfig.build = viteConfig.build || {};\n const viteSourceMap = viteConfig.build.sourcemap;\n\n let previousUserSourceMapSetting: UserSourceMapSetting;\n\n if (viteSourceMap === false) {\n warnExplicitlyDisabledSourceMap('vite.build.sourcemap');\n previousUserSourceMapSetting = 'disabled';\n } else if (viteSourceMap && ['hidden', 'inline', true].includes(viteSourceMap)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'vite.build.sourcemap', viteSourceMap.toString());\n previousUserSourceMapSetting = 'enabled';\n } else {\n viteConfig.build.sourcemap = 'hidden';\n logSentryEnablesSourceMap('vite.build.sourcemap', 'hidden');\n previousUserSourceMapSetting = 'unset';\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** only exported for testing */\nexport function changeRollupSourceMapSettings(\n nitroConfig: {\n rollupConfig?: {\n output?: {\n sourcemap?: OutputOptions['sourcemap'];\n sourcemapExcludeSources?: OutputOptions['sourcemapExcludeSources'];\n };\n };\n },\n sentryModuleOptions: SentryNuxtModuleOptions,\n): UserSourceMapSetting {\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n\n let previousUserSourceMapSetting: UserSourceMapSetting;\n\n const nitroSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n if (nitroSourceMap === false) {\n warnExplicitlyDisabledSourceMap('nitro.rollupConfig.output.sourcemap');\n previousUserSourceMapSetting = 'disabled';\n } else if (nitroSourceMap && ['hidden', 'inline', true].includes(nitroSourceMap)) {\n logKeepSourceMapSetting(sentryModuleOptions, 'nitro.rollupConfig.output.sourcemap', nitroSourceMap.toString());\n previousUserSourceMapSetting = 'enabled';\n } else {\n nitroConfig.rollupConfig.output.sourcemap = 'hidden';\n logSentryEnablesSourceMap('nitro.rollupConfig.output.sourcemap', 'hidden');\n previousUserSourceMapSetting = 'unset';\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Disabled source map setting in the Nuxt config: `nitro.rollupConfig.output.sourcemapExcludeSources`. Source maps will include the actual code to be able to un-minify code snippets in Sentry.',\n );\n });\n\n return previousUserSourceMapSetting;\n}\n\nfunction logKeepSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We discovered \\`${settingKey}\\` is set to \\`${settingValue}\\`. Sentry will keep this source map setting. This will un-minify the code snippet on the Sentry Issue page.`,\n );\n });\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Parts of source map generation are currently disabled in your Nuxt configuration (\\`${settingKey}: false\\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n });\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n });\n}\n"],"names":[],"mappings":";;;;AA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EAAmE,EAAE,UAAU,CAAC,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;AACvH,GAAG,CAAC;AACJ;;;;"}
@@ -3,6 +3,47 @@ import { SentryRollupPluginOptions } from '@sentry/rollup-plugin';
3
3
  import { SentryVitePluginOptions } from '@sentry/vite-plugin';
4
4
 
5
5
  type SourceMapsOptions = {
6
+ /**
7
+ * Suppresses all logs.
8
+ *
9
+ * @default false
10
+ */
11
+ silent?: boolean;
12
+ /**
13
+ * When an error occurs during release creation or sourcemaps upload, the plugin will call this function.
14
+ *
15
+ * By default, the plugin will simply throw an error, thereby stopping the bundling process.
16
+ * If an `errorHandler` callback is provided, compilation will continue, unless an error is
17
+ * thrown in the provided callback.
18
+ *
19
+ * To allow compilation to continue but still emit a warning, set this option to the following:
20
+ *
21
+ * ```js
22
+ * (err) => {
23
+ * console.warn(err);
24
+ * }
25
+ * ```
26
+ */
27
+ errorHandler?: (err: Error) => void;
28
+ /**
29
+ * Options related to managing the Sentry releases for a build.
30
+ *
31
+ * More info: https://docs.sentry.io/product/releases/
32
+ */
33
+ release?: {
34
+ /**
35
+ * Unique identifier for the release you want to create.
36
+ *
37
+ * This value can also be specified via the `SENTRY_RELEASE` environment variable.
38
+ *
39
+ * Defaults to automatically detecting a value for your environment.
40
+ * This includes values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses the git `HEAD`'s commit SHA.
41
+ * (the latter requires access to git CLI and for the root directory to be a valid repository)
42
+ *
43
+ * If you didn't provide a value and the plugin can't automatically detect one, no release will be created.
44
+ */
45
+ name?: string;
46
+ };
6
47
  /**
7
48
  * If this flag is `true`, and an auth token is detected, the Sentry SDK will
8
49
  * automatically generate and upload source maps to Sentry during a production build.
@@ -81,6 +122,12 @@ type SourceMapsOptions = {
81
122
  * Build options for the Sentry module. These options are used during build-time by the Sentry SDK.
82
123
  */
83
124
  type SentryNuxtModuleOptions = {
125
+ /**
126
+ * Enable the Sentry Nuxt Module.
127
+ *
128
+ * @default true
129
+ */
130
+ enabled?: boolean;
84
131
  /**
85
132
  * Options for the Sentry Vite plugin to customize the source maps upload process.
86
133
  *
@@ -3,6 +3,47 @@ import { SentryRollupPluginOptions } from '@sentry/rollup-plugin';
3
3
  import { SentryVitePluginOptions } from '@sentry/vite-plugin';
4
4
 
5
5
  type SourceMapsOptions = {
6
+ /**
7
+ * Suppresses all logs.
8
+ *
9
+ * @default false
10
+ */
11
+ silent?: boolean;
12
+ /**
13
+ * When an error occurs during release creation or sourcemaps upload, the plugin will call this function.
14
+ *
15
+ * By default, the plugin will simply throw an error, thereby stopping the bundling process.
16
+ * If an `errorHandler` callback is provided, compilation will continue, unless an error is
17
+ * thrown in the provided callback.
18
+ *
19
+ * To allow compilation to continue but still emit a warning, set this option to the following:
20
+ *
21
+ * ```js
22
+ * (err) => {
23
+ * console.warn(err);
24
+ * }
25
+ * ```
26
+ */
27
+ errorHandler?: (err: Error) => void;
28
+ /**
29
+ * Options related to managing the Sentry releases for a build.
30
+ *
31
+ * More info: https://docs.sentry.io/product/releases/
32
+ */
33
+ release?: {
34
+ /**
35
+ * Unique identifier for the release you want to create.
36
+ *
37
+ * This value can also be specified via the `SENTRY_RELEASE` environment variable.
38
+ *
39
+ * Defaults to automatically detecting a value for your environment.
40
+ * This includes values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses the git `HEAD`'s commit SHA.
41
+ * (the latter requires access to git CLI and for the root directory to be a valid repository)
42
+ *
43
+ * If you didn't provide a value and the plugin can't automatically detect one, no release will be created.
44
+ */
45
+ name?: string;
46
+ };
6
47
  /**
7
48
  * If this flag is `true`, and an auth token is detected, the Sentry SDK will
8
49
  * automatically generate and upload source maps to Sentry during a production build.
@@ -81,6 +122,12 @@ type SourceMapsOptions = {
81
122
  * Build options for the Sentry module. These options are used during build-time by the Sentry SDK.
82
123
  */
83
124
  type SentryNuxtModuleOptions = {
125
+ /**
126
+ * Enable the Sentry Nuxt Module.
127
+ *
128
+ * @default true
129
+ */
130
+ enabled?: boolean;
84
131
  /**
85
132
  * Options for the Sentry Vite plugin to customize the source maps upload process.
86
133
  *
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.7.0"
6
6
  },
7
- "version": "9.0.0-alpha.1",
7
+ "version": "9.0.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -274,6 +274,12 @@ function getPluginOptions(moduleOptions, deleteFilesAfterUpload) {
274
274
  telemetry: sourceMapsUploadOptions.telemetry ?? true,
275
275
  url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,
276
276
  debug: moduleOptions.debug ?? false,
277
+ silent: sourceMapsUploadOptions.silent ?? false,
278
+ errorHandler: sourceMapsUploadOptions.errorHandler,
279
+ release: {
280
+ name: sourceMapsUploadOptions.release?.name,
281
+ ...moduleOptions?.unstable_sentryBundlerPluginOptions?.release
282
+ },
277
283
  _metaOptions: {
278
284
  telemetry: {
279
285
  metaFramework: "nuxt"
@@ -417,6 +423,9 @@ const module = defineNuxtModule({
417
423
  },
418
424
  defaults: {},
419
425
  setup(moduleOptionsParam, nuxt) {
426
+ if (moduleOptionsParam?.enabled === false) {
427
+ return;
428
+ }
420
429
  const moduleOptions = {
421
430
  ...moduleOptionsParam,
422
431
  autoInjectServerSentry: moduleOptionsParam.autoInjectServerSentry,
@@ -39,7 +39,9 @@ export default defineNitroPlugin((nitroApp) => {
39
39
  });
40
40
  });
41
41
  async function flushIfServerless() {
42
- const isServerless = !!process.env.LAMBDA_TASK_ROOT || !!process.env.VERCEL || !!process.env.NETLIFY;
42
+ const isServerless = !!process.env.FUNCTIONS_WORKER_RUNTIME || // Azure Functions
43
+ !!process.env.LAMBDA_TASK_ROOT || // AWS Lambda
44
+ !!process.env.VERCEL || !!process.env.NETLIFY;
43
45
  if (GLOBAL_OBJ[Symbol.for("@vercel/request-context")]) {
44
46
  vercelWaitUntil(flushWithTimeout());
45
47
  } else if (isServerless) {
@@ -6,7 +6,7 @@
6
6
  export declare const piniaIntegration: (pinia: unknown, options?: {
7
7
  attachPiniaState?: boolean | undefined;
8
8
  addBreadcrumbs?: boolean | undefined;
9
- actionTransformer?: ((action: any) => any) | undefined;
10
- stateTransformer?: ((state: any) => any) | undefined;
9
+ actionTransformer?: ((action: string) => any) | undefined;
10
+ stateTransformer?: ((state: Record<string, unknown>) => any) | undefined;
11
11
  } | undefined) => import("@sentry/core").Integration;
12
12
  //# sourceMappingURL=piniaIntegration.d.ts.map
@@ -5,6 +5,47 @@ import type { init as initVue } from '@sentry/vue';
5
5
  export type SentryNuxtClientOptions = Omit<Parameters<typeof initVue>[0] & object, 'app'>;
6
6
  export type SentryNuxtServerOptions = Omit<Parameters<typeof initNode>[0] & object, 'app'>;
7
7
  type SourceMapsOptions = {
8
+ /**
9
+ * Suppresses all logs.
10
+ *
11
+ * @default false
12
+ */
13
+ silent?: boolean;
14
+ /**
15
+ * When an error occurs during release creation or sourcemaps upload, the plugin will call this function.
16
+ *
17
+ * By default, the plugin will simply throw an error, thereby stopping the bundling process.
18
+ * If an `errorHandler` callback is provided, compilation will continue, unless an error is
19
+ * thrown in the provided callback.
20
+ *
21
+ * To allow compilation to continue but still emit a warning, set this option to the following:
22
+ *
23
+ * ```js
24
+ * (err) => {
25
+ * console.warn(err);
26
+ * }
27
+ * ```
28
+ */
29
+ errorHandler?: (err: Error) => void;
30
+ /**
31
+ * Options related to managing the Sentry releases for a build.
32
+ *
33
+ * More info: https://docs.sentry.io/product/releases/
34
+ */
35
+ release?: {
36
+ /**
37
+ * Unique identifier for the release you want to create.
38
+ *
39
+ * This value can also be specified via the `SENTRY_RELEASE` environment variable.
40
+ *
41
+ * Defaults to automatically detecting a value for your environment.
42
+ * This includes values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses the git `HEAD`'s commit SHA.
43
+ * (the latter requires access to git CLI and for the root directory to be a valid repository)
44
+ *
45
+ * If you didn't provide a value and the plugin can't automatically detect one, no release will be created.
46
+ */
47
+ name?: string;
48
+ };
8
49
  /**
9
50
  * If this flag is `true`, and an auth token is detected, the Sentry SDK will
10
51
  * automatically generate and upload source maps to Sentry during a production build.
@@ -83,6 +124,12 @@ type SourceMapsOptions = {
83
124
  * Build options for the Sentry module. These options are used during build-time by the Sentry SDK.
84
125
  */
85
126
  export type SentryNuxtModuleOptions = {
127
+ /**
128
+ * Enable the Sentry Nuxt Module.
129
+ *
130
+ * @default true
131
+ */
132
+ enabled?: boolean;
86
133
  /**
87
134
  * Options for the Sentry Vite plugin to customize the source maps upload process.
88
135
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAGnD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,CAAC;AAC1F,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,CAAC;AAE3F,KAAK,iBAAiB,GAAG;IACvB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAG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GG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,sBAAsB,CAAC,EAAE,kBAAkB,GAAG,6BAA6B,CAAC;IAE5E;;;;;;;;;;OAUG;IACH,uCAAuC,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnD;;;;;OAKG;IACH,mCAAmC,CAAC,EAAE,yBAAyB,GAAG,uBAAuB,CAAC;CAC3F,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAK9D,MAAM,MAAM,aAAa,GAAG,uBAAuB,CAAC;;AAEpD,wBA0IG"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAK9D,MAAM,MAAM,aAAa,GAAG,uBAAuB,CAAC;;AAEpD,wBA8IG"}
@@ -1 +1 @@
1
- {"version":3,"file":"sourceMaps.d.ts","sourceRoot":"","sources":["../../../src/vite/sourceMaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,KAAK,yBAAyB,EAAsB,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,qBAAqB,CAAC;AAErF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhF;;GAEG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,uBAAuB,EAAE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D;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhF;;GAEG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CA2CxF;AASD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,uBAAuB,EACtC,sBAAsB,EAAE,OAAO,GAC9B,uBAAuB,GAAG,yBAAyB,CA+CrD;AAgBD,gCAAgC;AAChC,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,EACV,mBAAmB,EAAE,uBAAuB,GAC3C;IAAE,MAAM,EAAE,oBAAoB,CAAC;IAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,CAyDhE;AAED,gCAAgC;AAChC,wBAAgB,2BAA2B,CACzC,UAAU,EAAE;IAAE,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;KAAE,CAAA;CAAE,EACrE,mBAAmB,EAAE,uBAAuB,GAC3C,oBAAoB,CAmBtB;AAED,gCAAgC;AAChC,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE;IACX,YAAY,CAAC,EAAE;QACb,MAAM,CAAC,EAAE;YACP,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;YACvC,uBAAuB,CAAC,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC;SACpE,CAAC;KACH,CAAC;CACH,EACD,mBAAmB,EAAE,uBAAuB,GAC3C,oBAAoB,CA6BtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/nuxt",
3
- "version": "9.0.0-alpha.1",
3
+ "version": "9.0.0",
4
4
  "description": "Official Sentry SDK for Nuxt (EXPERIMENTAL)",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/nuxt",
@@ -43,13 +43,13 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@nuxt/kit": "^3.13.2",
46
- "@sentry/browser": "9.0.0-alpha.1",
47
- "@sentry/core": "9.0.0-alpha.1",
48
- "@sentry/node": "9.0.0-alpha.1",
49
- "@sentry/opentelemetry": "9.0.0-alpha.1",
50
- "@sentry/rollup-plugin": "2.22.7",
46
+ "@sentry/browser": "9.0.0",
47
+ "@sentry/core": "9.0.0",
48
+ "@sentry/node": "9.0.0",
49
+ "@sentry/opentelemetry": "9.0.0",
50
+ "@sentry/rollup-plugin": "3.1.2",
51
51
  "@sentry/vite-plugin": "2.22.6",
52
- "@sentry/vue": "9.0.0-alpha.1"
52
+ "@sentry/vue": "9.0.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@nuxt/module-builder": "^0.8.4",