@sentry/nuxt 9.6.1 → 9.7.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.
- package/build/cjs/module.js +0 -12
- package/build/cjs/module.js.map +1 -1
- package/build/esm/module.js +0 -12
- package/build/esm/module.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/module/module.json +1 -1
- package/build/module/module.mjs +0 -12
- package/build/types/module.d.ts.map +1 -1
- package/package.json +6 -6
package/build/cjs/module.js
CHANGED
|
@@ -60,18 +60,6 @@ const module$1 = kit.defineNuxtModule({
|
|
|
60
60
|
const serverConfigFile = utils.findDefaultSdkInitFile('server');
|
|
61
61
|
|
|
62
62
|
if (serverConfigFile) {
|
|
63
|
-
if (moduleOptions.autoInjectServerSentry !== 'experimental_dynamic-import') {
|
|
64
|
-
kit.addPluginTemplate({
|
|
65
|
-
mode: 'server',
|
|
66
|
-
filename: 'sentry-server-config.mjs',
|
|
67
|
-
getContents: () =>
|
|
68
|
-
// 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.
|
|
69
|
-
`import "${buildDirResolver.resolve(`/${serverConfigFile}`)}";
|
|
70
|
-
import { defineNuxtPlugin } from "#imports";
|
|
71
|
-
export default defineNuxtPlugin(() => {});`,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
63
|
kit.addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/sentry.server'));
|
|
76
64
|
}
|
|
77
65
|
|
package/build/cjs/module.js.map
CHANGED
|
@@ -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 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, 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;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,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;;AAEA;AACA,YAAA,MAAA,wBAAA,GAAA,CAAA,CAAA,EAAA,IAAA,CAAA,GAAA,CAAA,EAAA,IAAA,CAAA,QAAA,CAAA,KAAA,CAAA,OAAA,CAAA,OAAA,EAAA,gBAAA,CAAA,CAAA,CAAA;;AAEA,YAAAM,mBAAA,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,UAAAE,kCAAA,CAAA,aAAA,EAAA,KAAA,CAAA;AACA;;AAEA,QAAA,IAAA,aAAA,CAAA,sBAAA,KAAA,6BAAA,EAAA;AACA,UAAAC,gDAAA,CAAA,KAAA,EAAA,gBAAA,EAAA,aAAA,CAAA;;AAEA,UAAA,IAAA,aAAA,CAAA,KAAA,EAAA;AACA,YAAAH,mBAAA,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 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, 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;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,GAAEC,kBAAc,CAAC,2PAAe,CAAC;AAC7D,IAAI,MAAM,gBAAiB,GAAEA,kBAAc,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;;AAElE,IAAI,MAAM,gBAAiB,GAAEC,4BAAsB,CAAC,QAAQ,CAAC;;AAE7D,IAAI,IAAI,gBAAgB,EAAE;AAC1B;AACA,MAAMC,qBAAiB,CAAC;AACxB,QAAQ,IAAI,EAAE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AAA,GAAA;AACA,gBAAA,8HAAA;AACA,eAAA;AACA,aAAA,CAAA;AACA;AACA;AACA;AACA,KAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA;;;;"}
|
package/build/esm/module.js
CHANGED
|
@@ -59,18 +59,6 @@ const module = defineNuxtModule({
|
|
|
59
59
|
const serverConfigFile = findDefaultSdkInitFile('server');
|
|
60
60
|
|
|
61
61
|
if (serverConfigFile) {
|
|
62
|
-
if (moduleOptions.autoInjectServerSentry !== 'experimental_dynamic-import') {
|
|
63
|
-
addPluginTemplate({
|
|
64
|
-
mode: 'server',
|
|
65
|
-
filename: 'sentry-server-config.mjs',
|
|
66
|
-
getContents: () =>
|
|
67
|
-
// 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.
|
|
68
|
-
`import "${buildDirResolver.resolve(`/${serverConfigFile}`)}";
|
|
69
|
-
import { defineNuxtPlugin } from "#imports";
|
|
70
|
-
export default defineNuxtPlugin(() => {});`,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
62
|
addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/sentry.server'));
|
|
75
63
|
}
|
|
76
64
|
|
package/build/esm/module.js.map
CHANGED
|
@@ -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 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, 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;;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A,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 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, 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;AAC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A,gBAAA,GAAA,iBAAA,CAAA,OAAA,CAAA,0BAAA,CAAA;;AAEA;AACA,YAAA,MAAA,wBAAA,GAAA,CAAA,CAAA,EAAA,IAAA,CAAA,GAAA,CAAA,EAAA,IAAA,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;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"9.
|
|
1
|
+
{"type":"module","version":"9.7.0"}
|
package/build/module/module.json
CHANGED
package/build/module/module.mjs
CHANGED
|
@@ -490,18 +490,6 @@ const module = defineNuxtModule({
|
|
|
490
490
|
}
|
|
491
491
|
const serverConfigFile = findDefaultSdkInitFile("server");
|
|
492
492
|
if (serverConfigFile) {
|
|
493
|
-
if (moduleOptions.autoInjectServerSentry !== "experimental_dynamic-import") {
|
|
494
|
-
addPluginTemplate({
|
|
495
|
-
mode: "server",
|
|
496
|
-
filename: "sentry-server-config.mjs",
|
|
497
|
-
getContents: () => (
|
|
498
|
-
// 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.
|
|
499
|
-
`import "${buildDirResolver.resolve(`/${serverConfigFile}`)}";
|
|
500
|
-
import { defineNuxtPlugin } from "#imports";
|
|
501
|
-
export default defineNuxtPlugin(() => {});`
|
|
502
|
-
)
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
493
|
addServerPlugin(moduleDirResolver.resolve("./runtime/plugins/sentry.server"));
|
|
506
494
|
}
|
|
507
495
|
if (clientConfigFile || serverConfigFile) {
|
|
@@ -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,
|
|
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,wBAkIG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/nuxt",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.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.
|
|
47
|
-
"@sentry/core": "9.
|
|
48
|
-
"@sentry/node": "9.
|
|
49
|
-
"@sentry/opentelemetry": "9.
|
|
46
|
+
"@sentry/browser": "9.7.0",
|
|
47
|
+
"@sentry/core": "9.7.0",
|
|
48
|
+
"@sentry/node": "9.7.0",
|
|
49
|
+
"@sentry/opentelemetry": "9.7.0",
|
|
50
50
|
"@sentry/rollup-plugin": "3.1.2",
|
|
51
51
|
"@sentry/vite-plugin": "2.22.6",
|
|
52
|
-
"@sentry/vue": "9.
|
|
52
|
+
"@sentry/vue": "9.7.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@nuxt/module-builder": "^0.8.4",
|