@sentry/nuxt 8.36.0-beta.0 → 8.37.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/client/index.js +2 -0
- package/build/cjs/client/index.js.map +1 -1
- package/build/cjs/client/piniaIntegration.js +40 -0
- package/build/cjs/client/piniaIntegration.js.map +1 -0
- package/build/cjs/client/sdk.js.map +1 -1
- package/build/cjs/index.client.js +2 -0
- package/build/cjs/index.client.js.map +1 -1
- package/build/cjs/module.js +3 -2
- package/build/cjs/module.js.map +1 -1
- package/build/cjs/runtime/plugins/sentry.client.js +5 -24
- package/build/cjs/runtime/plugins/sentry.client.js.map +1 -1
- package/build/cjs/runtime/plugins/sentry.server.js.map +1 -1
- package/build/cjs/runtime/utils.js.map +1 -1
- package/build/cjs/server/sdk.js.map +1 -1
- package/build/cjs/vite/addServerConfig.js +23 -12
- package/build/cjs/vite/addServerConfig.js.map +1 -1
- package/build/cjs/vite/sourceMaps.js.map +1 -1
- package/build/cjs/vite/utils.js +100 -28
- package/build/cjs/vite/utils.js.map +1 -1
- package/build/esm/client/index.js +1 -0
- package/build/esm/client/index.js.map +1 -1
- package/build/esm/client/piniaIntegration.js +38 -0
- package/build/esm/client/piniaIntegration.js.map +1 -0
- package/build/esm/client/sdk.js.map +1 -1
- package/build/esm/index.client.js +1 -0
- package/build/esm/index.client.js.map +1 -1
- package/build/esm/module.js +2 -1
- package/build/esm/module.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/runtime/plugins/sentry.client.js +3 -22
- package/build/esm/runtime/plugins/sentry.client.js.map +1 -1
- package/build/esm/runtime/plugins/sentry.server.js.map +1 -1
- package/build/esm/runtime/utils.js.map +1 -1
- package/build/esm/server/sdk.js.map +1 -1
- package/build/esm/vite/addServerConfig.js +24 -13
- package/build/esm/vite/addServerConfig.js.map +1 -1
- package/build/esm/vite/sourceMaps.js.map +1 -1
- package/build/esm/vite/utils.js +98 -28
- package/build/esm/vite/utils.js.map +1 -1
- package/build/module/module.d.mts +12 -0
- package/build/module/module.d.ts +12 -0
- package/build/module/module.json +1 -1
- package/build/module/module.mjs +65 -19
- package/build/module/runtime/plugins/sentry.client.js +5 -21
- package/build/types/client/index.d.ts +1 -0
- package/build/types/client/index.d.ts.map +1 -1
- package/build/types/client/piniaIntegration.d.ts +12 -0
- package/build/types/client/piniaIntegration.d.ts.map +1 -0
- package/build/types/common/types.d.ts +14 -12
- package/build/types/common/types.d.ts.map +1 -1
- package/build/types/index.types.d.ts.map +1 -1
- package/build/types/module.d.ts.map +1 -1
- package/build/types/runtime/plugins/sentry.client.d.ts.map +1 -1
- package/build/types/vite/addServerConfig.d.ts +1 -1
- package/build/types/vite/addServerConfig.d.ts.map +1 -1
- package/build/types/vite/utils.d.ts +15 -6
- package/build/types/vite/utils.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -2,10 +2,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
2
2
|
|
|
3
3
|
const vue = require('@sentry/vue');
|
|
4
4
|
const sdk = require('./sdk.js');
|
|
5
|
+
const piniaIntegration = require('./piniaIntegration.js');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
exports.init = sdk.init;
|
|
10
|
+
exports.piniaIntegration = piniaIntegration.piniaIntegration;
|
|
9
11
|
Object.prototype.hasOwnProperty.call(vue, '__proto__') &&
|
|
10
12
|
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
11
13
|
Object.defineProperty(exports, '__proto__', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const utils = require('@sentry/utils');
|
|
5
|
+
const vue = require('@sentry/vue');
|
|
6
|
+
|
|
7
|
+
const INTEGRATION_NAME = 'Pinia';
|
|
8
|
+
|
|
9
|
+
const _piniaIntegration = ((
|
|
10
|
+
// `unknown` here as well because usePinia declares this type: `export declare const usePinia: () => unknown;`
|
|
11
|
+
pinia,
|
|
12
|
+
options = {},
|
|
13
|
+
) => {
|
|
14
|
+
return {
|
|
15
|
+
name: INTEGRATION_NAME,
|
|
16
|
+
setup() {
|
|
17
|
+
if (!pinia || (typeof pinia === 'object' && !('use' in pinia))) {
|
|
18
|
+
utils.consoleSandbox(() => {
|
|
19
|
+
// eslint-disable-next-line no-console
|
|
20
|
+
console.warn(
|
|
21
|
+
'[Sentry] The Pinia integration was added, but the passed parameter `pinia` has the wrong value. Make sure to enable Pinia by adding `"@pinia/nuxt"` to the Nuxt modules array and pass pinia to Sentry with `piniaIntegration(usePinia())`. Current value of `pinia`:',
|
|
22
|
+
pinia,
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
(pinia ).use(vue.createSentryPiniaPlugin(options));
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}) ;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Monitor an existing Pinia store.
|
|
34
|
+
*
|
|
35
|
+
* This only works if "@pinia/nuxt" is added to the `modules` array.
|
|
36
|
+
*/
|
|
37
|
+
const piniaIntegration = core.defineIntegration(_piniaIntegration);
|
|
38
|
+
|
|
39
|
+
exports.piniaIntegration = piniaIntegration;
|
|
40
|
+
//# sourceMappingURL=piniaIntegration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"piniaIntegration.js","sources":["../../../src/client/piniaIntegration.ts"],"sourcesContent":["import { defineIntegration } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\n\nimport { consoleSandbox } from '@sentry/utils';\nimport { createSentryPiniaPlugin } from '@sentry/vue';\n\nconst INTEGRATION_NAME = 'Pinia';\n\ntype Pinia = { use: (plugin: ReturnType<typeof createSentryPiniaPlugin>) => void };\n\nconst _piniaIntegration = ((\n // `unknown` here as well because usePinia declares this type: `export declare const usePinia: () => unknown;`\n pinia: unknown | Pinia,\n options: Parameters<typeof createSentryPiniaPlugin>[0] = {},\n) => {\n return {\n name: INTEGRATION_NAME,\n setup() {\n if (!pinia || (typeof pinia === 'object' && !('use' in pinia))) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n '[Sentry] The Pinia integration was added, but the passed parameter `pinia` has the wrong value. Make sure to enable Pinia by adding `\"@pinia/nuxt\"` to the Nuxt modules array and pass pinia to Sentry with `piniaIntegration(usePinia())`. Current value of `pinia`:',\n pinia,\n );\n });\n } else {\n (pinia as Pinia).use(createSentryPiniaPlugin(options));\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Monitor an existing Pinia store.\n *\n * This only works if \"@pinia/nuxt\" is added to the `modules` array.\n */\nexport const piniaIntegration = defineIntegration(_piniaIntegration);\n"],"names":["consoleSandbox","createSentryPiniaPlugin","defineIntegration"],"mappings":";;;;;;AAMA,MAAM,gBAAA,GAAmB,OAAO;;AAIhC,MAAM,iBAAA,IAAqB;AAC3B;AACA,EAAE,KAAK;AACP,EAAE,OAAO,GAAkD,EAAE;AAC7D,KAAK;AACL,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,GAAG;AACZ,MAAM,IAAI,CAAC,UAAU,OAAO,KAAM,KAAI,QAAS,IAAG,EAAE,KAAA,IAAS,KAAK,CAAC,CAAC,EAAE;AACtE,QAAQA,oBAAc,CAAC,MAAM;AAC7B;AACA,UAAU,OAAO,CAAC,IAAI;AACtB,YAAY,uQAAuQ;AACnR,YAAY,KAAK;AACjB,WAAW;AACX,SAAS,CAAC;AACV,aAAa;AACb,QAAQ,CAAC,KAAM,GAAU,GAAG,CAACC,2BAAuB,CAAC,OAAO,CAAC,CAAC;AAC9D;AACA,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAEC,sBAAiB,CAAC,iBAAiB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../../src/client/sdk.ts"],"sourcesContent":["import { getDefaultIntegrations as getBrowserDefaultIntegrations, init as initBrowser } from '@sentry/browser';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { Client } from '@sentry/types';\nimport type { SentryNuxtClientOptions } from '../common/types';\n\n/**\n * Initializes the client-side of the Nuxt SDK\n *\n * @param options Configuration options for the SDK.\n */\nexport function init(options: SentryNuxtClientOptions): Client | undefined {\n const sentryOptions = {\n /* BrowserTracing is added later with the Nuxt client plugin */\n defaultIntegrations: [...getBrowserDefaultIntegrations(options)],\n ...options,\n };\n\n applySdkMetadata(sentryOptions, 'nuxt', ['nuxt', 'vue']);\n\n return initBrowser(sentryOptions);\n}\n"],"names":["getBrowserDefaultIntegrations","applySdkMetadata","initBrowser"],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAA+C;AAC3E,EAAE,MAAM,gBAAgB;AACxB;AACA,IAAI,mBAAmB,EAAE,CAAC,GAAGA,8BAA6B,CAAC,OAAO,CAAC,CAAC;AACpE,IAAI,GAAG,OAAO;AACd,GAAG,
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../../src/client/sdk.ts"],"sourcesContent":["import { getDefaultIntegrations as getBrowserDefaultIntegrations, init as initBrowser } from '@sentry/browser';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { Client } from '@sentry/types';\nimport type { SentryNuxtClientOptions } from '../common/types';\n\n/**\n * Initializes the client-side of the Nuxt SDK\n *\n * @param options Configuration options for the SDK.\n */\nexport function init(options: SentryNuxtClientOptions): Client | undefined {\n const sentryOptions = {\n /* BrowserTracing is added later with the Nuxt client plugin */\n defaultIntegrations: [...getBrowserDefaultIntegrations(options)],\n ...options,\n };\n\n applySdkMetadata(sentryOptions, 'nuxt', ['nuxt', 'vue']);\n\n return initBrowser(sentryOptions);\n}\n"],"names":["getBrowserDefaultIntegrations","applySdkMetadata","initBrowser"],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAA+C;AAC3E,EAAE,MAAM,gBAAgB;AACxB;AACA,IAAI,mBAAmB,EAAE,CAAC,GAAGA,8BAA6B,CAAC,OAAO,CAAC,CAAC;AACpE,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAEC,qBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;;AAE1D,EAAE,OAAOC,YAAW,CAAC,aAAa,CAAC;AACnC;;;;"}
|
|
@@ -2,10 +2,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
2
2
|
|
|
3
3
|
const vue = require('@sentry/vue');
|
|
4
4
|
const sdk = require('./client/sdk.js');
|
|
5
|
+
const piniaIntegration = require('./client/piniaIntegration.js');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
exports.init = sdk.init;
|
|
10
|
+
exports.piniaIntegration = piniaIntegration.piniaIntegration;
|
|
9
11
|
Object.prototype.hasOwnProperty.call(vue, '__proto__') &&
|
|
10
12
|
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
11
13
|
Object.defineProperty(exports, '__proto__', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
package/build/cjs/module.js
CHANGED
|
@@ -19,9 +19,10 @@ const module$1 = kit.defineNuxtModule({
|
|
|
19
19
|
const moduleOptions = {
|
|
20
20
|
...moduleOptionsParam,
|
|
21
21
|
dynamicImportForServerEntry: moduleOptionsParam.dynamicImportForServerEntry !== false, // default: true
|
|
22
|
+
entrypointWrappedFunctions: moduleOptionsParam.entrypointWrappedFunctions || ['default', 'handler', 'server'],
|
|
22
23
|
};
|
|
23
24
|
|
|
24
|
-
const moduleDirResolver = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('module.js', document.baseURI).href)));
|
|
25
|
+
const moduleDirResolver = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('module.js', document.baseURI).href)));
|
|
25
26
|
const buildDirResolver = kit.createResolver(nuxt.options.buildDir);
|
|
26
27
|
|
|
27
28
|
const clientConfigFile = utils.findDefaultSdkInitFile('client');
|
|
@@ -99,7 +100,7 @@ const module$1 = kit.defineNuxtModule({
|
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
} else {
|
|
102
|
-
addServerConfig.addDynamicImportEntryFileWrapper(nitro, serverConfigFile);
|
|
103
|
+
addServerConfig.addDynamicImportEntryFileWrapper(nitro, serverConfigFile, moduleOptions);
|
|
103
104
|
|
|
104
105
|
if (moduleOptions.debug) {
|
|
105
106
|
utils$1.consoleSandbox(() => {
|
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/utils';\nimport type { SentryNuxtModuleOptions } from './common/types';\nimport { addDynamicImportEntryFileWrapper, 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.0.0',\n },\n },\n defaults: {},\n setup(moduleOptionsParam, nuxt) {\n const moduleOptions = {\n ...moduleOptionsParam,\n dynamicImportForServerEntry: moduleOptionsParam.dynamicImportForServerEntry !== false, // default: true\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.dynamicImportForServerEntry === false) {\n // Inject the server-side Sentry config file with a side effect import\n addPluginTemplate({\n mode: 'server',\n filename: 'sentry-server-config.mjs',\n getContents: () =>\n `import \"${buildDirResolver.resolve(`/${serverConfigFile}`)}\"\\n` +\n 'import { defineNuxtPlugin } from \"#imports\"\\n' +\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 && 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 is in beta and may not work as expected on the server-side (Nitro). Errors are reported, but tracing does not work.',\n );\n });\n }\n\n if (moduleOptions.dynamicImportForServerEntry === false) {\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 } else {\n addDynamicImportEntryFileWrapper(nitro, serverConfigFile);\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","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,QAAQ;AACpB,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,2BAA2B,EAAE,kBAAkB,CAAC,2BAAA,KAAgC,KAAK;AAC3F,
|
|
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/utils';\nimport type { SentryNuxtModuleOptions } from './common/types';\nimport { addDynamicImportEntryFileWrapper, 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.0.0',\n },\n },\n defaults: {},\n setup(moduleOptionsParam, nuxt) {\n const moduleOptions = {\n ...moduleOptionsParam,\n dynamicImportForServerEntry: moduleOptionsParam.dynamicImportForServerEntry !== false, // default: true\n entrypointWrappedFunctions: moduleOptionsParam.entrypointWrappedFunctions || ['default', 'handler', 'server'],\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.dynamicImportForServerEntry === false) {\n // Inject the server-side Sentry config file with a side effect import\n addPluginTemplate({\n mode: 'server',\n filename: 'sentry-server-config.mjs',\n getContents: () =>\n `import \"${buildDirResolver.resolve(`/${serverConfigFile}`)}\"\\n` +\n 'import { defineNuxtPlugin } from \"#imports\"\\n' +\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 && 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 is in beta and may not work as expected on the server-side (Nitro). Errors are reported, but tracing does not work.',\n );\n });\n }\n\n if (moduleOptions.dynamicImportForServerEntry === false) {\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 } else {\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","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,QAAQ;AACpB,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,2BAA2B,EAAE,kBAAkB,CAAC,2BAAA,KAAgC,KAAK;AAC3F,MAAM,0BAA0B,EAAE,kBAAkB,CAAC,0BAA2B,IAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC;AACnH,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,QAAQ;AACtB,QAAQ,QAAQ,EAAE,0BAA0B;;AAE5C;AACA;AACA,QAAQ,WAAW,EAAE,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aAAA,CAAA,2BAAA,KAAA,KAAA,EAAA;AACA,UAAAC,sCAAA,CAAA,aAAA,EAAA,IAAA,EAAA,KAAA,EAAA,gBAAA,CAAA;;AAEA,UAAA,IAAA,aAAA,CAAA,KAAA,EAAA;AACA,YAAA,MAAA,iBAAA,GAAAP,kBAAA,CAAA,KAAA,CAAA,OAAA,CAAA,MAAA,CAAA,SAAA,CAAA;AACA,YAAA,MAAA,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,YAAAM,sBAAA,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,SAAA,MAAA;AACA,UAAAE,gDAAA,CAAA,KAAA,EAAA,gBAAA,EAAA,aAAA,CAAA;;AAEA,UAAA,IAAA,aAAA,CAAA,KAAA,EAAA;AACA,YAAAF,sBAAA,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,8 +1,7 @@
|
|
|
1
1
|
const core = require('@sentry/core');
|
|
2
|
-
const utils = require('@sentry/utils');
|
|
3
2
|
const vue = require('@sentry/vue');
|
|
4
3
|
const app = require('nuxt/app');
|
|
5
|
-
const utils
|
|
4
|
+
const utils = require('../utils.js');
|
|
6
5
|
|
|
7
6
|
// --- Types are copied from @sentry/vue (so it does not need to be exported) ---
|
|
8
7
|
// The following type is an intersection of the Route type from VueRouter v2, v3, and v4.
|
|
@@ -12,12 +11,11 @@ const sentry_client = app.defineNuxtPlugin({
|
|
|
12
11
|
name: 'sentry-client-integrations',
|
|
13
12
|
dependsOn: ['sentry-client-config'],
|
|
14
13
|
async setup(nuxtApp) {
|
|
15
|
-
const sentryClient = core.getClient();
|
|
16
|
-
const clientOptions = sentryClient && sentryClient.getOptions();
|
|
17
|
-
|
|
18
14
|
// This evaluates to true unless __SENTRY_TRACING__ is text-replaced with "false", in which case everything inside
|
|
19
15
|
// will get tree-shaken away
|
|
20
16
|
if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) {
|
|
17
|
+
const sentryClient = core.getClient();
|
|
18
|
+
|
|
21
19
|
if (sentryClient && '$router' in nuxtApp) {
|
|
22
20
|
sentryClient.addIntegration(
|
|
23
21
|
vue.browserTracingIntegration({ router: nuxtApp.$router , routeLabel: 'path' }),
|
|
@@ -25,23 +23,6 @@ const sentry_client = app.defineNuxtPlugin({
|
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
if (clientOptions && 'trackPinia' in clientOptions && clientOptions.trackPinia) {
|
|
29
|
-
if ('$pinia' in nuxtApp) {
|
|
30
|
-
(nuxtApp.$pinia ).use(
|
|
31
|
-
// `trackPinia` is an object with custom options or `true` (pass `undefined` to use default options)
|
|
32
|
-
vue.createSentryPiniaPlugin(clientOptions.trackPinia === true ? undefined : clientOptions.trackPinia),
|
|
33
|
-
);
|
|
34
|
-
} else {
|
|
35
|
-
clientOptions.debug &&
|
|
36
|
-
utils.consoleSandbox(() => {
|
|
37
|
-
// eslint-disable-next-line no-console
|
|
38
|
-
console.warn(
|
|
39
|
-
'[Sentry] You set `trackPinia`, but the Pinia module was not found. Make sure to add `"@pinia/nuxt"` to your modules array.',
|
|
40
|
-
);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
26
|
nuxtApp.hook('app:created', vueApp => {
|
|
46
27
|
const sentryClient = core.getClient();
|
|
47
28
|
|
|
@@ -54,11 +35,11 @@ const sentry_client = app.defineNuxtPlugin({
|
|
|
54
35
|
});
|
|
55
36
|
|
|
56
37
|
nuxtApp.hook('app:error', error => {
|
|
57
|
-
utils
|
|
38
|
+
utils.reportNuxtError({ error });
|
|
58
39
|
});
|
|
59
40
|
|
|
60
41
|
nuxtApp.hook('vue:error', (error, instance, info) => {
|
|
61
|
-
utils
|
|
42
|
+
utils.reportNuxtError({ error, instance, info });
|
|
62
43
|
});
|
|
63
44
|
},
|
|
64
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry.client.js","sources":["../../../../src/runtime/plugins/sentry.client.ts"],"sourcesContent":["import { getClient } from '@sentry/core';\nimport {
|
|
1
|
+
{"version":3,"file":"sentry.client.js","sources":["../../../../src/runtime/plugins/sentry.client.ts"],"sourcesContent":["import { getClient } from '@sentry/core';\nimport { browserTracingIntegration, vueIntegration } from '@sentry/vue';\nimport { defineNuxtPlugin } from 'nuxt/app';\nimport { reportNuxtError } from '../utils';\n\n// --- Types are copied from @sentry/vue (so it does not need to be exported) ---\n// The following type is an intersection of the Route type from VueRouter v2, v3, and v4.\n// This is not great, but kinda necessary to make it work with all versions at the same time.\ntype Route = {\n /** Unparameterized URL */\n path: string;\n /**\n * Query params (keys map to null when there is no value associated, e.g. \"?foo\" and to an array when there are\n * multiple query params that have the same key, e.g. \"?foo&foo=bar\")\n */\n query: Record<string, string | null | (string | null)[]>;\n /** Route name (VueRouter provides a way to give routes individual names) */\n name?: string | symbol | null | undefined;\n /** Evaluated parameters */\n params: Record<string, string | string[]>;\n /** All the matched route objects as defined in VueRouter constructor */\n matched: { path: string }[];\n};\n\ninterface VueRouter {\n onError: (fn: (err: Error) => void) => void;\n beforeEach: (fn: (to: Route, from: Route, next?: () => void) => void) => void;\n}\n\n// Tree-shakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean;\n\nexport default defineNuxtPlugin({\n name: 'sentry-client-integrations',\n dependsOn: ['sentry-client-config'],\n async setup(nuxtApp) {\n // This evaluates to true unless __SENTRY_TRACING__ is text-replaced with \"false\", in which case everything inside\n // will get tree-shaken away\n if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) {\n const sentryClient = getClient();\n\n if (sentryClient && '$router' in nuxtApp) {\n sentryClient.addIntegration(\n browserTracingIntegration({ router: nuxtApp.$router as VueRouter, routeLabel: 'path' }),\n );\n }\n }\n\n nuxtApp.hook('app:created', vueApp => {\n const sentryClient = getClient();\n\n if (sentryClient) {\n // Adding the Vue integration without the Vue error handler\n // Nuxt is registering their own error handler, which is unset after hydration: https://github.com/nuxt/nuxt/blob/d3fdbcaac6cf66d21e25d259390d7824696f1a87/packages/nuxt/src/app/entry.ts#L64-L73\n // We don't want to wrap the existing error handler, as it leads to a 500 error: https://github.com/getsentry/sentry-javascript/issues/12515\n sentryClient.addIntegration(vueIntegration({ app: vueApp, attachErrorHandler: false }));\n }\n });\n\n nuxtApp.hook('app:error', error => {\n reportNuxtError({ error });\n });\n\n nuxtApp.hook('vue:error', (error, instance, info) => {\n reportNuxtError({ error, instance, info });\n });\n },\n});\n"],"names":["defineNuxtPlugin","getClient","browserTracingIntegration","vueIntegration","reportNuxtError"],"mappings":";;;;;AAKA;AACA;AACA;;AAyBA,sBAAeA,oBAAgB,CAAC;AAChC,EAAE,IAAI,EAAE,4BAA4B;AACpC,EAAE,SAAS,EAAE,CAAC,sBAAsB,CAAC;AACrC,EAAE,MAAM,KAAK,CAAC,OAAO,EAAE;AACvB;AACA;AACA,IAAI,IAAI,OAAO,kBAAA,KAAuB,WAAY,IAAG,kBAAkB,EAAE;AACzE,MAAM,MAAM,YAAA,GAAeC,cAAS,EAAE;;AAEtC,MAAM,IAAI,YAAA,IAAgB,SAAU,IAAG,OAAO,EAAE;AAChD,QAAQ,YAAY,CAAC,cAAc;AACnC,UAAUC,6BAAyB,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,OAAA,GAAsB,UAAU,EAAE,MAAA,EAAQ,CAAC;AACjG,SAAS;AACT;AACA;;AAEA,IAAI,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU;AAC1C,MAAM,MAAM,YAAA,GAAeD,cAAS,EAAE;;AAEtC,MAAM,IAAI,YAAY,EAAE;AACxB;AACA;AACA;AACA,QAAQ,YAAY,CAAC,cAAc,CAACE,kBAAc,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAM,EAAC,CAAC,CAAC;AAC/F;AACA,KAAK,CAAC;;AAEN,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS;AACvC,MAAMC,qBAAe,CAAC,EAAE,KAAA,EAAO,CAAC;AAChC,KAAK,CAAC;;AAEN,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,KAAK;AACzD,MAAMA,qBAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAK,EAAC,CAAC;AAChD,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry.server.js","sources":["../../../../src/runtime/plugins/sentry.server.ts"],"sourcesContent":["import * as Sentry from '@sentry/node';\nimport { H3Error } from 'h3';\nimport { defineNitroPlugin } from 'nitropack/runtime';\nimport type { NuxtRenderHTMLContext } from 'nuxt/app';\nimport { addSentryTracingMetaTags, extractErrorContext } from '../utils';\n\nexport default defineNitroPlugin(nitroApp => {\n nitroApp.hooks.hook('error', (error, errorContext) => {\n // Do not handle 404 and 422\n if (error instanceof H3Error) {\n // Do not report if status code is 3xx or 4xx\n if (error.statusCode >= 300 && error.statusCode < 500) {\n return;\n }\n }\n\n const { method, path } = {\n method: errorContext.event && errorContext.event._method ? errorContext.event._method : '',\n path: errorContext.event && errorContext.event._path ? errorContext.event._path : null,\n };\n\n if (path) {\n Sentry.getCurrentScope().setTransactionName(`${method} ${path}`);\n }\n\n const structuredContext = extractErrorContext(errorContext);\n\n Sentry.captureException(error, {\n captureContext: { contexts: { nuxt: structuredContext } },\n mechanism: { handled: false },\n });\n });\n\n // @ts-expect-error - 'render:html' is a valid hook name in the Nuxt context\n nitroApp.hooks.hook('render:html', (html: NuxtRenderHTMLContext) => {\n addSentryTracingMetaTags(html.head);\n });\n});\n"],"names":["defineNitroPlugin","H3Error","extractErrorContext","addSentryTracingMetaTags"],"mappings":";;;;;AAMA,sBAAeA,yBAAiB,CAAC,QAAA,IAAY;AAC7C,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK;AACxD;AACA,IAAI,IAAI,KAAM,YAAWC,UAAO,EAAE;AAClC;AACA,MAAM,IAAI,KAAK,CAAC,UAAW,IAAG,GAAI,IAAG,KAAK,CAAC,UAAW,GAAE,GAAG,EAAE;AAC7D,QAAQ
|
|
1
|
+
{"version":3,"file":"sentry.server.js","sources":["../../../../src/runtime/plugins/sentry.server.ts"],"sourcesContent":["import * as Sentry from '@sentry/node';\nimport { H3Error } from 'h3';\nimport { defineNitroPlugin } from 'nitropack/runtime';\nimport type { NuxtRenderHTMLContext } from 'nuxt/app';\nimport { addSentryTracingMetaTags, extractErrorContext } from '../utils';\n\nexport default defineNitroPlugin(nitroApp => {\n nitroApp.hooks.hook('error', (error, errorContext) => {\n // Do not handle 404 and 422\n if (error instanceof H3Error) {\n // Do not report if status code is 3xx or 4xx\n if (error.statusCode >= 300 && error.statusCode < 500) {\n return;\n }\n }\n\n const { method, path } = {\n method: errorContext.event && errorContext.event._method ? errorContext.event._method : '',\n path: errorContext.event && errorContext.event._path ? errorContext.event._path : null,\n };\n\n if (path) {\n Sentry.getCurrentScope().setTransactionName(`${method} ${path}`);\n }\n\n const structuredContext = extractErrorContext(errorContext);\n\n Sentry.captureException(error, {\n captureContext: { contexts: { nuxt: structuredContext } },\n mechanism: { handled: false },\n });\n });\n\n // @ts-expect-error - 'render:html' is a valid hook name in the Nuxt context\n nitroApp.hooks.hook('render:html', (html: NuxtRenderHTMLContext) => {\n addSentryTracingMetaTags(html.head);\n });\n});\n"],"names":["defineNitroPlugin","H3Error","extractErrorContext","addSentryTracingMetaTags"],"mappings":";;;;;AAMA,sBAAeA,yBAAiB,CAAC,QAAA,IAAY;AAC7C,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK;AACxD;AACA,IAAI,IAAI,KAAM,YAAWC,UAAO,EAAE;AAClC;AACA,MAAM,IAAI,KAAK,CAAC,UAAW,IAAG,GAAI,IAAG,KAAK,CAAC,UAAW,GAAE,GAAG,EAAE;AAC7D,QAAQ;AACR;AACA;;AAEA,IAAI,MAAM,EAAE,MAAM,EAAE,IAAA,KAAS;AAC7B,MAAM,MAAM,EAAE,YAAY,CAAC,KAAM,IAAG,YAAY,CAAC,KAAK,CAAC,OAAA,GAAU,YAAY,CAAC,KAAK,CAAC,OAAA,GAAU,EAAE;AAChG,MAAM,IAAI,EAAE,YAAY,CAAC,KAAM,IAAG,YAAY,CAAC,KAAK,CAAC,KAAA,GAAQ,YAAY,CAAC,KAAK,CAAC,KAAA,GAAQ,IAAI;AAC5F,KAAK;;AAEL,IAAI,IAAI,IAAI,EAAE;AACd,MAAM,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAA,MAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA;;AAEA,IAAA,MAAA,iBAAA,GAAAC,yBAAA,CAAA,YAAA,CAAA;;AAEA,IAAA,MAAA,CAAA,gBAAA,CAAA,KAAA,EAAA;AACA,MAAA,cAAA,EAAA,EAAA,QAAA,EAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,EAAA;AACA,MAAA,SAAA,EAAA,EAAA,OAAA,EAAA,KAAA,EAAA;AACA,KAAA,CAAA;AACA,GAAA,CAAA;;AAEA;AACA,EAAA,QAAA,CAAA,KAAA,CAAA,IAAA,CAAA,aAAA,EAAA,CAAA,IAAA,KAAA;AACA,IAAAC,8BAAA,CAAA,IAAA,CAAA,IAAA,CAAA;AACA,GAAA,CAAA;AACA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/runtime/utils.ts"],"sourcesContent":["import { captureException, getClient, getTraceMetaTags } from '@sentry/core';\nimport type { ClientOptions, Context } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport type { VueOptions } from '@sentry/vue/src/types';\nimport type { CapturedErrorContext } from 'nitropack';\nimport type { NuxtRenderHTMLContext } from 'nuxt/app';\nimport type { ComponentPublicInstance } from 'vue';\n\n/**\n * Extracts the relevant context information from the error context (H3Event in Nitro Error)\n * and created a structured context object.\n */\nexport function extractErrorContext(errorContext: CapturedErrorContext): Context {\n const structuredContext: Context = {\n method: undefined,\n path: undefined,\n tags: undefined,\n };\n\n if (errorContext) {\n if (errorContext.event) {\n structuredContext.method = errorContext.event._method || undefined;\n structuredContext.path = errorContext.event._path || undefined;\n }\n\n if (Array.isArray(errorContext.tags)) {\n structuredContext.tags = errorContext.tags || undefined;\n }\n }\n\n return dropUndefinedKeys(structuredContext);\n}\n\n/**\n * Adds Sentry tracing <meta> tags to the returned html page.\n *\n * Exported only for testing\n */\nexport function addSentryTracingMetaTags(head: NuxtRenderHTMLContext['head']): void {\n const metaTags = getTraceMetaTags();\n\n if (metaTags) {\n head.push(metaTags);\n }\n}\n\n/**\n * Reports an error to Sentry. This function is similar to `attachErrorHandler` in `@sentry/vue`.\n * The Nuxt SDK does not register an error handler, but uses the Nuxt error hooks to report errors.\n *\n * We don't want to use the error handling from `@sentry/vue` as it wraps the existing error handler, which leads to a 500 error: https://github.com/getsentry/sentry-javascript/issues/12515\n */\nexport function reportNuxtError(options: {\n error: unknown;\n instance?: ComponentPublicInstance | null;\n info?: string;\n}): void {\n const { error, instance, info } = options;\n\n const metadata: Record<string, unknown> = {\n info,\n // todo: add component name and trace (like in the vue integration)\n };\n\n if (instance && instance.$props) {\n const sentryClient = getClient();\n const sentryOptions = sentryClient ? (sentryClient.getOptions() as ClientOptions & VueOptions) : null;\n\n // `attachProps` is enabled by default and props should only not be attached if explicitly disabled (see DEFAULT_CONFIG in `vueIntegration`).\n if (sentryOptions && sentryOptions.attachProps && instance.$props !== false) {\n metadata.propsData = instance.$props;\n }\n }\n\n // Capture exception in the next event loop, to make sure that all breadcrumbs are recorded in time.\n setTimeout(() => {\n captureException(error, {\n captureContext: { contexts: { nuxt: metadata } },\n mechanism: { handled: false },\n });\n });\n}\n"],"names":["dropUndefinedKeys","getTraceMetaTags","getClient","captureException"],"mappings":";;;;;AAQA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,YAAY,EAAiC;AACjF,EAAE,MAAM,iBAAiB,GAAY;AACrC,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,IAAI,EAAE,SAAS;AACnB,IAAI,IAAI,EAAE,SAAS;AACnB,GAAG,
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/runtime/utils.ts"],"sourcesContent":["import { captureException, getClient, getTraceMetaTags } from '@sentry/core';\nimport type { ClientOptions, Context } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport type { VueOptions } from '@sentry/vue/src/types';\nimport type { CapturedErrorContext } from 'nitropack';\nimport type { NuxtRenderHTMLContext } from 'nuxt/app';\nimport type { ComponentPublicInstance } from 'vue';\n\n/**\n * Extracts the relevant context information from the error context (H3Event in Nitro Error)\n * and created a structured context object.\n */\nexport function extractErrorContext(errorContext: CapturedErrorContext): Context {\n const structuredContext: Context = {\n method: undefined,\n path: undefined,\n tags: undefined,\n };\n\n if (errorContext) {\n if (errorContext.event) {\n structuredContext.method = errorContext.event._method || undefined;\n structuredContext.path = errorContext.event._path || undefined;\n }\n\n if (Array.isArray(errorContext.tags)) {\n structuredContext.tags = errorContext.tags || undefined;\n }\n }\n\n return dropUndefinedKeys(structuredContext);\n}\n\n/**\n * Adds Sentry tracing <meta> tags to the returned html page.\n *\n * Exported only for testing\n */\nexport function addSentryTracingMetaTags(head: NuxtRenderHTMLContext['head']): void {\n const metaTags = getTraceMetaTags();\n\n if (metaTags) {\n head.push(metaTags);\n }\n}\n\n/**\n * Reports an error to Sentry. This function is similar to `attachErrorHandler` in `@sentry/vue`.\n * The Nuxt SDK does not register an error handler, but uses the Nuxt error hooks to report errors.\n *\n * We don't want to use the error handling from `@sentry/vue` as it wraps the existing error handler, which leads to a 500 error: https://github.com/getsentry/sentry-javascript/issues/12515\n */\nexport function reportNuxtError(options: {\n error: unknown;\n instance?: ComponentPublicInstance | null;\n info?: string;\n}): void {\n const { error, instance, info } = options;\n\n const metadata: Record<string, unknown> = {\n info,\n // todo: add component name and trace (like in the vue integration)\n };\n\n if (instance && instance.$props) {\n const sentryClient = getClient();\n const sentryOptions = sentryClient ? (sentryClient.getOptions() as ClientOptions & VueOptions) : null;\n\n // `attachProps` is enabled by default and props should only not be attached if explicitly disabled (see DEFAULT_CONFIG in `vueIntegration`).\n if (sentryOptions && sentryOptions.attachProps && instance.$props !== false) {\n metadata.propsData = instance.$props;\n }\n }\n\n // Capture exception in the next event loop, to make sure that all breadcrumbs are recorded in time.\n setTimeout(() => {\n captureException(error, {\n captureContext: { contexts: { nuxt: metadata } },\n mechanism: { handled: false },\n });\n });\n}\n"],"names":["dropUndefinedKeys","getTraceMetaTags","getClient","captureException"],"mappings":";;;;;AAQA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,YAAY,EAAiC;AACjF,EAAE,MAAM,iBAAiB,GAAY;AACrC,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,IAAI,EAAE,SAAS;AACnB,IAAI,IAAI,EAAE,SAAS;AACnB,GAAG;;AAEH,EAAE,IAAI,YAAY,EAAE;AACpB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qBAAgB,CAAC,KAAK,EAAE;AAC5B,MAAM,cAAc,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAS,EAAA,EAAG;AACtD,MAAM,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO;AACnC,KAAK,CAAC;AACN,GAAG,CAAC;AACJ;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import { applySdkMetadata, flush, getGlobalScope } from '@sentry/core';\nimport {\n type NodeOptions,\n getDefaultIntegrations as getDefaultNodeIntegrations,\n httpIntegration,\n init as initNode,\n} from '@sentry/node';\nimport type { Client, EventProcessor, Integration } from '@sentry/types';\nimport { logger, vercelWaitUntil } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport type { SentryNuxtServerOptions } from '../common/types';\n\n/**\n * Initializes the server-side of the Nuxt SDK\n *\n * @param options Configuration options for the SDK.\n */\nexport function init(options: SentryNuxtServerOptions): Client | undefined {\n const sentryOptions = {\n ...options,\n registerEsmLoaderHooks: mergeRegisterEsmLoaderHooks(options),\n defaultIntegrations: getNuxtDefaultIntegrations(options),\n };\n\n applySdkMetadata(sentryOptions, 'nuxt', ['nuxt', 'node']);\n\n const client = initNode(sentryOptions);\n\n getGlobalScope().addEventProcessor(\n Object.assign(\n (event => {\n if (event.type === 'transaction') {\n // Filter out transactions for Nuxt build assets\n // This regex matches the default path to the nuxt-generated build assets (`_nuxt`).\n // todo: the buildAssetDir could be changed in the nuxt config - change this to a more generic solution\n if (event.transaction?.match(/^GET \\/_nuxt\\//)) {\n options.debug &&\n DEBUG_BUILD &&\n logger.log('NuxtLowQualityTransactionsFilter filtered transaction: ', event.transaction);\n return null;\n }\n\n return event;\n } else {\n return event;\n }\n }) satisfies EventProcessor,\n { id: 'NuxtLowQualityTransactionsFilter' },\n ),\n );\n\n return client;\n}\n\nfunction getNuxtDefaultIntegrations(options: NodeOptions): Integration[] {\n return [\n ...getDefaultNodeIntegrations(options).filter(integration => integration.name !== 'Http'),\n // The httpIntegration is added as defaultIntegration, so users can still overwrite it\n httpIntegration({\n instrumentation: {\n responseHook: () => {\n // Makes it possible to end the tracing span before closing the Vercel lambda (https://vercel.com/docs/functions/functions-api-reference#waituntil)\n vercelWaitUntil(flushSafelyWithTimeout());\n },\n },\n }),\n ];\n}\n\n/**\n * Adds /vue/ to the registerEsmLoaderHooks options and merges it with the old values in the array if one is defined.\n * If the registerEsmLoaderHooks option is already a boolean, nothing is changed.\n *\n * Only exported for Testing purposes.\n */\nexport function mergeRegisterEsmLoaderHooks(\n options: SentryNuxtServerOptions,\n): SentryNuxtServerOptions['registerEsmLoaderHooks'] {\n if (typeof options.registerEsmLoaderHooks === 'object' && options.registerEsmLoaderHooks !== null) {\n return {\n exclude: Array.isArray(options.registerEsmLoaderHooks.exclude)\n ? [...options.registerEsmLoaderHooks.exclude, /vue/]\n : options.registerEsmLoaderHooks.exclude ?? [/vue/],\n };\n }\n return options.registerEsmLoaderHooks ?? { exclude: [/vue/] };\n}\n\n/**\n * Flushes pending Sentry events with a 2-second timeout and in a way that cannot create unhandled promise rejections.\n */\nexport async function flushSafelyWithTimeout(): Promise<void> {\n try {\n DEBUG_BUILD && logger.log('Flushing events...');\n await flush(2000);\n DEBUG_BUILD && logger.log('Done flushing events');\n } catch (e) {\n DEBUG_BUILD && logger.log('Error while flushing events:\\n', e);\n }\n}\n"],"names":["applySdkMetadata","initNode","getGlobalScope","DEBUG_BUILD","logger","getDefaultNodeIntegrations","httpIntegration","vercelWaitUntil","flush"],"mappings":";;;;;;;;;;;;AAYA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,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A,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC;IACjBL,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAeC,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,GAAG,CAAC,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,CAAC;EACjD,EAAA,CAAO,CAAA,CAAA,CAAA,EAAA,CAAA,CAAC,EAAE;IACVD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAeC,CAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAM,CAAC,CAAA,CAAA,CAAG,CAAC,CAAgC,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAE,CAAC,CAAC;EAChE;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import { applySdkMetadata, flush, getGlobalScope } from '@sentry/core';\nimport {\n type NodeOptions,\n getDefaultIntegrations as getDefaultNodeIntegrations,\n httpIntegration,\n init as initNode,\n} from '@sentry/node';\nimport type { Client, EventProcessor, Integration } from '@sentry/types';\nimport { logger, vercelWaitUntil } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport type { SentryNuxtServerOptions } from '../common/types';\n\n/**\n * Initializes the server-side of the Nuxt SDK\n *\n * @param options Configuration options for the SDK.\n */\nexport function init(options: SentryNuxtServerOptions): Client | undefined {\n const sentryOptions = {\n ...options,\n registerEsmLoaderHooks: mergeRegisterEsmLoaderHooks(options),\n defaultIntegrations: getNuxtDefaultIntegrations(options),\n };\n\n applySdkMetadata(sentryOptions, 'nuxt', ['nuxt', 'node']);\n\n const client = initNode(sentryOptions);\n\n getGlobalScope().addEventProcessor(\n Object.assign(\n (event => {\n if (event.type === 'transaction') {\n // Filter out transactions for Nuxt build assets\n // This regex matches the default path to the nuxt-generated build assets (`_nuxt`).\n // todo: the buildAssetDir could be changed in the nuxt config - change this to a more generic solution\n if (event.transaction?.match(/^GET \\/_nuxt\\//)) {\n options.debug &&\n DEBUG_BUILD &&\n logger.log('NuxtLowQualityTransactionsFilter filtered transaction: ', event.transaction);\n return null;\n }\n\n return event;\n } else {\n return event;\n }\n }) satisfies EventProcessor,\n { id: 'NuxtLowQualityTransactionsFilter' },\n ),\n );\n\n return client;\n}\n\nfunction getNuxtDefaultIntegrations(options: NodeOptions): Integration[] {\n return [\n ...getDefaultNodeIntegrations(options).filter(integration => integration.name !== 'Http'),\n // The httpIntegration is added as defaultIntegration, so users can still overwrite it\n httpIntegration({\n instrumentation: {\n responseHook: () => {\n // Makes it possible to end the tracing span before closing the Vercel lambda (https://vercel.com/docs/functions/functions-api-reference#waituntil)\n vercelWaitUntil(flushSafelyWithTimeout());\n },\n },\n }),\n ];\n}\n\n/**\n * Adds /vue/ to the registerEsmLoaderHooks options and merges it with the old values in the array if one is defined.\n * If the registerEsmLoaderHooks option is already a boolean, nothing is changed.\n *\n * Only exported for Testing purposes.\n */\nexport function mergeRegisterEsmLoaderHooks(\n options: SentryNuxtServerOptions,\n): SentryNuxtServerOptions['registerEsmLoaderHooks'] {\n if (typeof options.registerEsmLoaderHooks === 'object' && options.registerEsmLoaderHooks !== null) {\n return {\n exclude: Array.isArray(options.registerEsmLoaderHooks.exclude)\n ? [...options.registerEsmLoaderHooks.exclude, /vue/]\n : options.registerEsmLoaderHooks.exclude ?? [/vue/],\n };\n }\n return options.registerEsmLoaderHooks ?? { exclude: [/vue/] };\n}\n\n/**\n * Flushes pending Sentry events with a 2-second timeout and in a way that cannot create unhandled promise rejections.\n */\nexport async function flushSafelyWithTimeout(): Promise<void> {\n try {\n DEBUG_BUILD && logger.log('Flushing events...');\n await flush(2000);\n DEBUG_BUILD && logger.log('Done flushing events');\n } catch (e) {\n DEBUG_BUILD && logger.log('Error while flushing events:\\n', e);\n }\n}\n"],"names":["applySdkMetadata","initNode","getGlobalScope","DEBUG_BUILD","logger","getDefaultNodeIntegrations","httpIntegration","vercelWaitUntil","flush"],"mappings":";;;;;;;;;;;;AAYA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA;CACA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;CACA,CAAA;AACO,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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AsB,CAAkB,EAAA;EAC5D,CAAI,CAAA,EAAA;IACFJ,uBAAeC,CAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAM,CAAC,CAAG,CAAA,CAAA,CAAC,oBAAoB,CAAC;IAC/C,CAAMI,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC;IACjBL,uBAAeC,CAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAM,CAAC,CAAG,CAAA,CAAA,CAAC,sBAAsB,CAAC;EACjD,EAAA,CAAO,CAAA,CAAA,CAAA,EAAA,CAAA,CAAC,EAAE;IACVD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAeC,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,GAAG,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgC,EAAE,CAAC,CAAC;EAClE;AACA;;;;"}
|
|
@@ -77,7 +77,12 @@ function addServerConfigToBuild(
|
|
|
77
77
|
* With this, the Sentry server config can be loaded before all other modules of the application (which is needed for import-in-the-middle).
|
|
78
78
|
* See: https://nodejs.org/api/module.html#enabling
|
|
79
79
|
*/
|
|
80
|
-
function addDynamicImportEntryFileWrapper(
|
|
80
|
+
function addDynamicImportEntryFileWrapper(
|
|
81
|
+
nitro,
|
|
82
|
+
serverConfigFile,
|
|
83
|
+
moduleOptions
|
|
84
|
+
,
|
|
85
|
+
) {
|
|
81
86
|
if (!nitro.options.rollupConfig) {
|
|
82
87
|
nitro.options.rollupConfig = { output: {} };
|
|
83
88
|
}
|
|
@@ -90,8 +95,10 @@ function addDynamicImportEntryFileWrapper(nitro, serverConfigFile) {
|
|
|
90
95
|
}
|
|
91
96
|
|
|
92
97
|
nitro.options.rollupConfig.plugins.push(
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
wrapEntryWithDynamicImport({
|
|
99
|
+
resolvedSentryConfigPath: kit.createResolver(nitro.options.srcDir).resolve(`/${serverConfigFile}`),
|
|
100
|
+
entrypointWrappedFunctions: moduleOptions.entrypointWrappedFunctions,
|
|
101
|
+
}),
|
|
95
102
|
);
|
|
96
103
|
}
|
|
97
104
|
|
|
@@ -100,7 +107,11 @@ function addDynamicImportEntryFileWrapper(nitro, serverConfigFile) {
|
|
|
100
107
|
* by using a regular `import` and load the server after that.
|
|
101
108
|
* This also works with serverless `handler` functions, as it re-exports the `handler`.
|
|
102
109
|
*/
|
|
103
|
-
function wrapEntryWithDynamicImport(
|
|
110
|
+
function wrapEntryWithDynamicImport({
|
|
111
|
+
resolvedSentryConfigPath,
|
|
112
|
+
entrypointWrappedFunctions,
|
|
113
|
+
debug,
|
|
114
|
+
}) {
|
|
104
115
|
return {
|
|
105
116
|
name: 'sentry-wrap-entry-with-dynamic-import',
|
|
106
117
|
async resolveId(source, importer, options) {
|
|
@@ -116,7 +127,7 @@ function wrapEntryWithDynamicImport(resolvedSentryConfigPath) {
|
|
|
116
127
|
return { id: source, moduleSideEffects: true, external: true };
|
|
117
128
|
}
|
|
118
129
|
|
|
119
|
-
if (options.isEntry && !source.includes(`.mjs${utils$1.SENTRY_WRAPPED_ENTRY}`)) {
|
|
130
|
+
if (options.isEntry && source.includes('.mjs') && !source.includes(`.mjs${utils$1.SENTRY_WRAPPED_ENTRY}`)) {
|
|
120
131
|
const resolution = await this.resolve(source, importer, options);
|
|
121
132
|
|
|
122
133
|
// If it cannot be resolved or is external, just return it so that Rollup can display an error
|
|
@@ -126,16 +137,15 @@ function wrapEntryWithDynamicImport(resolvedSentryConfigPath) {
|
|
|
126
137
|
|
|
127
138
|
moduleInfo.moduleSideEffects = true;
|
|
128
139
|
|
|
129
|
-
// The key `.` in `exportedBindings` refer to the exports within the file
|
|
130
|
-
const exportedFunctions = _optionalChain([moduleInfo, 'access', _11 => _11.exportedBindings, 'optionalAccess', _12 => _12['.']]);
|
|
131
|
-
|
|
132
140
|
// The enclosing `if` already checks for the suffix in `source`, but a check in `resolution.id` is needed as well to prevent multiple attachment of the suffix
|
|
133
141
|
return resolution.id.includes(`.mjs${utils$1.SENTRY_WRAPPED_ENTRY}`)
|
|
134
142
|
? resolution.id
|
|
135
143
|
: resolution.id
|
|
136
144
|
// Concatenates the query params to mark the file (also attaches names of re-exports - this is needed for serverless functions to re-export the handler)
|
|
137
145
|
.concat(utils$1.SENTRY_WRAPPED_ENTRY)
|
|
138
|
-
.concat(
|
|
146
|
+
.concat(
|
|
147
|
+
utils$1.constructWrappedFunctionExportQuery(moduleInfo.exportedBindings, entrypointWrappedFunctions, debug),
|
|
148
|
+
)
|
|
139
149
|
.concat(utils$1.QUERY_END_INDICATOR);
|
|
140
150
|
}
|
|
141
151
|
return null;
|
|
@@ -145,9 +155,10 @@ function wrapEntryWithDynamicImport(resolvedSentryConfigPath) {
|
|
|
145
155
|
const entryId = utils$1.removeSentryQueryFromPath(id);
|
|
146
156
|
|
|
147
157
|
// Mostly useful for serverless `handler` functions
|
|
148
|
-
const reExportedFunctions =
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
const reExportedFunctions =
|
|
159
|
+
id.includes(utils$1.SENTRY_WRAPPED_FUNCTIONS) || id.includes(utils$1.SENTRY_REEXPORTED_FUNCTIONS)
|
|
160
|
+
? utils$1.constructFunctionReExport(id, entryId)
|
|
161
|
+
: '';
|
|
151
162
|
|
|
152
163
|
return (
|
|
153
164
|
// Regular `import` of the Sentry config
|