@sentry/nuxt 8.42.0 → 8.44.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.
Files changed (101) hide show
  1. package/build/cjs/module.js +40 -10
  2. package/build/cjs/module.js.map +1 -1
  3. package/build/cjs/runtime/nitro-utils/build/esm/nitro/patchEventHandler.js +43 -0
  4. package/build/cjs/runtime/nitro-utils/build/esm/nitro/patchEventHandler.js.map +1 -0
  5. package/build/cjs/runtime/nitro-utils/build/esm/util/flush.js +36 -0
  6. package/build/cjs/runtime/nitro-utils/build/esm/util/flush.js.map +1 -0
  7. package/build/cjs/runtime/nuxt/src/runtime/plugins/sentry.client.js.map +1 -0
  8. package/build/cjs/runtime/{plugins → nuxt/src/runtime/plugins}/sentry.server.js +31 -1
  9. package/build/cjs/runtime/nuxt/src/runtime/plugins/sentry.server.js.map +1 -0
  10. package/build/cjs/runtime/nuxt/src/runtime/utils.js.map +1 -0
  11. package/build/cjs/vite/addServerConfig.js +92 -36
  12. package/build/cjs/vite/addServerConfig.js.map +1 -1
  13. package/build/cjs/vite/utils.js +11 -1
  14. package/build/cjs/vite/utils.js.map +1 -1
  15. package/build/esm/module.js +41 -11
  16. package/build/esm/module.js.map +1 -1
  17. package/build/esm/package.json +1 -1
  18. package/build/esm/runtime/nitro-utils/build/esm/nitro/patchEventHandler.js +41 -0
  19. package/build/esm/runtime/nitro-utils/build/esm/nitro/patchEventHandler.js.map +1 -0
  20. package/build/esm/runtime/nitro-utils/build/esm/util/flush.js +33 -0
  21. package/build/esm/runtime/nitro-utils/build/esm/util/flush.js.map +1 -0
  22. package/build/esm/runtime/nuxt/src/runtime/plugins/sentry.client.js.map +1 -0
  23. package/build/esm/runtime/{plugins → nuxt/src/runtime/plugins}/sentry.server.js +31 -1
  24. package/build/esm/runtime/nuxt/src/runtime/plugins/sentry.server.js.map +1 -0
  25. package/build/esm/runtime/nuxt/src/runtime/utils.js.map +1 -0
  26. package/build/esm/vite/addServerConfig.js +93 -38
  27. package/build/esm/vite/addServerConfig.js.map +1 -1
  28. package/build/esm/vite/utils.js +11 -2
  29. package/build/esm/vite/utils.js.map +1 -1
  30. package/build/module/module.d.mts +23 -10
  31. package/build/module/module.d.ts +23 -10
  32. package/build/module/module.json +1 -1
  33. package/build/module/module.mjs +98 -37
  34. package/build/module/runtime/plugins/sentry.server.js +24 -1
  35. package/build/types/build.config.d.ts +3 -0
  36. package/build/types/build.config.d.ts.map +1 -0
  37. package/build/types/src/client/index.d.ts.map +1 -0
  38. package/build/types/src/client/piniaIntegration.d.ts.map +1 -0
  39. package/build/types/src/client/sdk.d.ts.map +1 -0
  40. package/build/types/src/client/vueIntegration.d.ts.map +1 -0
  41. package/build/types/src/common/debug-build.d.ts.map +1 -0
  42. package/build/types/{common → src/common}/types.d.ts +23 -10
  43. package/build/types/src/common/types.d.ts.map +1 -0
  44. package/build/types/src/index.client.d.ts.map +1 -0
  45. package/build/types/src/index.server.d.ts.map +1 -0
  46. package/build/types/src/index.types.d.ts.map +1 -0
  47. package/build/types/src/module.d.ts.map +1 -0
  48. package/build/types/src/runtime/plugins/sentry.client.d.ts.map +1 -0
  49. package/build/types/src/runtime/plugins/sentry.server.d.ts.map +1 -0
  50. package/build/types/src/runtime/utils.d.ts.map +1 -0
  51. package/build/types/src/server/index.d.ts.map +1 -0
  52. package/build/types/src/server/sdk.d.ts.map +1 -0
  53. package/build/types/{vite → src/vite}/addServerConfig.d.ts +7 -1
  54. package/build/types/src/vite/addServerConfig.d.ts.map +1 -0
  55. package/build/types/src/vite/sourceMaps.d.ts.map +1 -0
  56. package/build/types/{vite → src/vite}/utils.d.ts +4 -0
  57. package/build/types/src/vite/utils.d.ts.map +1 -0
  58. package/package.json +8 -7
  59. package/build/cjs/runtime/plugins/sentry.client.js.map +0 -1
  60. package/build/cjs/runtime/plugins/sentry.server.js.map +0 -1
  61. package/build/cjs/runtime/utils.js.map +0 -1
  62. package/build/esm/runtime/plugins/sentry.client.js.map +0 -1
  63. package/build/esm/runtime/plugins/sentry.server.js.map +0 -1
  64. package/build/esm/runtime/utils.js.map +0 -1
  65. package/build/types/client/index.d.ts.map +0 -1
  66. package/build/types/client/piniaIntegration.d.ts.map +0 -1
  67. package/build/types/client/sdk.d.ts.map +0 -1
  68. package/build/types/client/vueIntegration.d.ts.map +0 -1
  69. package/build/types/common/debug-build.d.ts.map +0 -1
  70. package/build/types/common/types.d.ts.map +0 -1
  71. package/build/types/index.client.d.ts.map +0 -1
  72. package/build/types/index.server.d.ts.map +0 -1
  73. package/build/types/index.types.d.ts.map +0 -1
  74. package/build/types/module.d.ts.map +0 -1
  75. package/build/types/runtime/plugins/sentry.client.d.ts.map +0 -1
  76. package/build/types/runtime/plugins/sentry.server.d.ts.map +0 -1
  77. package/build/types/runtime/utils.d.ts.map +0 -1
  78. package/build/types/server/index.d.ts.map +0 -1
  79. package/build/types/server/sdk.d.ts.map +0 -1
  80. package/build/types/vite/addServerConfig.d.ts.map +0 -1
  81. package/build/types/vite/sourceMaps.d.ts.map +0 -1
  82. package/build/types/vite/utils.d.ts.map +0 -1
  83. /package/build/cjs/runtime/{plugins → nuxt/src/runtime/plugins}/sentry.client.js +0 -0
  84. /package/build/cjs/runtime/{utils.js → nuxt/src/runtime/utils.js} +0 -0
  85. /package/build/esm/runtime/{plugins → nuxt/src/runtime/plugins}/sentry.client.js +0 -0
  86. /package/build/esm/runtime/{utils.js → nuxt/src/runtime/utils.js} +0 -0
  87. /package/build/types/{client → src/client}/index.d.ts +0 -0
  88. /package/build/types/{client → src/client}/piniaIntegration.d.ts +0 -0
  89. /package/build/types/{client → src/client}/sdk.d.ts +0 -0
  90. /package/build/types/{client → src/client}/vueIntegration.d.ts +0 -0
  91. /package/build/types/{common → src/common}/debug-build.d.ts +0 -0
  92. /package/build/types/{index.client.d.ts → src/index.client.d.ts} +0 -0
  93. /package/build/types/{index.server.d.ts → src/index.server.d.ts} +0 -0
  94. /package/build/types/{index.types.d.ts → src/index.types.d.ts} +0 -0
  95. /package/build/types/{module.d.ts → src/module.d.ts} +0 -0
  96. /package/build/types/{runtime → src/runtime}/plugins/sentry.client.d.ts +0 -0
  97. /package/build/types/{runtime → src/runtime}/plugins/sentry.server.d.ts +0 -0
  98. /package/build/types/{runtime → src/runtime}/utils.d.ts +0 -0
  99. /package/build/types/{server → src/server}/index.d.ts +0 -0
  100. /package/build/types/{server → src/server}/sdk.d.ts +0 -0
  101. /package/build/types/{vite → src/vite}/sourceMaps.d.ts +0 -0
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.7.0"
6
6
  },
7
- "version": "8.42.0",
7
+ "version": "8.44.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -21,6 +21,11 @@ function findDefaultSdkInitFile(type) {
21
21
  }
22
22
  return filePaths.find((filename) => fs.existsSync(filename));
23
23
  }
24
+ function getFilenameFromNodeStartCommand(nodeCommand) {
25
+ const regex = /[^/\\]+$/;
26
+ const match = nodeCommand.match(regex);
27
+ return match ? match[0] : null;
28
+ }
24
29
  const SENTRY_WRAPPED_ENTRY = "?sentry-query-wrapped-entry";
25
30
  const SENTRY_WRAPPED_FUNCTIONS = "?sentry-query-wrapped-functions=";
26
31
  const SENTRY_REEXPORTED_FUNCTIONS = "?sentry-query-reexported-functions=";
@@ -59,7 +64,7 @@ function constructWrappedFunctionExportQuery(exportedBindings, entrypointWrapped
59
64
  () => (
60
65
  // eslint-disable-next-line no-console
61
66
  console.warn(
62
- "[Sentry] No functions found to wrap. In case the server needs to export async functions other than `handler` or `server`, consider adding the name(s) to Sentry's build options `sentry.entrypointWrappedFunctions` in `nuxt.config.ts`."
67
+ "[Sentry] No functions found to wrap. In case the server needs to export async functions other than `handler` or `server`, consider adding the name(s) to Sentry's build options `sentry.experimental_entrypointWrappedFunctions` in `nuxt.config.ts`."
63
68
  )
64
69
  )
65
70
  );
@@ -94,32 +99,61 @@ function addServerConfigToBuild(moduleOptions, nuxt, nitro, serverConfigFile) {
94
99
  if (typeof viteInlineConfig?.build?.rollupOptions?.input === "object" && "server" in viteInlineConfig.build.rollupOptions.input) {
95
100
  viteInlineConfig.build.rollupOptions.input[SERVER_CONFIG_FILENAME] = createResolver(nuxt.options.srcDir).resolve(`/${serverConfigFile}`);
96
101
  }
97
- nitro.hooks.hook("close", async () => {
98
- const buildDirResolver = createResolver(nitro.options.buildDir);
99
- const serverDirResolver = createResolver(nitro.options.output.serverDir);
100
- const source = buildDirResolver.resolve(`dist/server/${SERVER_CONFIG_FILENAME}.mjs`);
101
- const destination = serverDirResolver.resolve(`${SERVER_CONFIG_FILENAME}.mjs`);
102
- try {
103
- await fs.promises.access(source, fs.constants.F_OK);
104
- await fs.promises.copyFile(source, destination);
105
- if (moduleOptions.debug) {
106
- consoleSandbox(() => {
102
+ });
103
+ nitro.hooks.hook("close", async () => {
104
+ const buildDirResolver = createResolver(nitro.options.buildDir);
105
+ const serverDirResolver = createResolver(nitro.options.output.serverDir);
106
+ const source = buildDirResolver.resolve(`dist/server/${SERVER_CONFIG_FILENAME}.mjs`);
107
+ const destination = serverDirResolver.resolve(`${SERVER_CONFIG_FILENAME}.mjs`);
108
+ try {
109
+ await fs.promises.access(source, fs.constants.F_OK);
110
+ await fs.promises.copyFile(source, destination);
111
+ if (moduleOptions.debug) {
112
+ consoleSandbox(() => {
113
+ console.log(
114
+ `[Sentry] Successfully added the content of the \`${serverConfigFile}\` file to \`${destination}\``
115
+ );
116
+ });
117
+ }
118
+ } catch (error) {
119
+ if (moduleOptions.debug) {
120
+ consoleSandbox(() => {
121
+ console.warn(
122
+ `[Sentry] An error occurred when trying to add the \`${serverConfigFile}\` file to the \`.output\` directory`,
123
+ error
124
+ );
125
+ });
126
+ }
127
+ }
128
+ });
129
+ }
130
+ function addSentryTopImport(moduleOptions, nitro) {
131
+ nitro.hooks.hook("close", async () => {
132
+ const fileNameFromCommand = nitro.options.commands.preview && getFilenameFromNodeStartCommand(nitro.options.commands.preview);
133
+ const presetsWithServerFile = ["netlify"];
134
+ const entryFileName = fileNameFromCommand ? fileNameFromCommand : typeof nitro.options.rollupConfig?.output.entryFileNames === "string" ? nitro.options.rollupConfig?.output.entryFileNames : presetsWithServerFile.includes(nitro.options.preset) ? "server.mjs" : "index.mjs";
135
+ const serverDirResolver = createResolver(nitro.options.output.serverDir);
136
+ const entryFilePath = serverDirResolver.resolve(entryFileName);
137
+ try {
138
+ fs.readFile(entryFilePath, "utf8", (err, data) => {
139
+ const updatedContent = `import './${SERVER_CONFIG_FILENAME}.mjs';
140
+ ${data}`;
141
+ fs.writeFile(entryFilePath, updatedContent, "utf8", () => {
142
+ if (moduleOptions.debug) {
107
143
  console.log(
108
- `[Sentry] Successfully added the content of the \`${serverConfigFile}\` file to \`${destination}\``
109
- );
110
- });
111
- }
112
- } catch (error) {
113
- if (moduleOptions.debug) {
114
- consoleSandbox(() => {
115
- console.warn(
116
- `[Sentry] An error occurred when trying to add the \`${serverConfigFile}\` file to the \`.output\` directory`,
117
- error
144
+ `[Sentry] Successfully added the Sentry import to the server entry file "\`${entryFilePath}\`"`
118
145
  );
119
- });
120
- }
146
+ }
147
+ });
148
+ });
149
+ } catch (err) {
150
+ if (moduleOptions.debug) {
151
+ console.warn(
152
+ `[Sentry] An error occurred when trying to add the Sentry import to the server entry file "\`${entryFilePath}\`":`,
153
+ err
154
+ );
121
155
  }
122
- });
156
+ }
123
157
  });
124
158
  }
125
159
  function addDynamicImportEntryFileWrapper(nitro, serverConfigFile, moduleOptions) {
@@ -134,13 +168,13 @@ function addDynamicImportEntryFileWrapper(nitro, serverConfigFile, moduleOptions
134
168
  nitro.options.rollupConfig.plugins.push(
135
169
  wrapEntryWithDynamicImport({
136
170
  resolvedSentryConfigPath: createResolver(nitro.options.srcDir).resolve(`/${serverConfigFile}`),
137
- entrypointWrappedFunctions: moduleOptions.entrypointWrappedFunctions
171
+ experimental_entrypointWrappedFunctions: moduleOptions.experimental_entrypointWrappedFunctions
138
172
  })
139
173
  );
140
174
  }
141
175
  function wrapEntryWithDynamicImport({
142
176
  resolvedSentryConfigPath,
143
- entrypointWrappedFunctions,
177
+ experimental_entrypointWrappedFunctions,
144
178
  debug
145
179
  }) {
146
180
  const resolutionIdPrefix = "\0raw";
@@ -160,7 +194,11 @@ function wrapEntryWithDynamicImport({
160
194
  const moduleInfo = await this.load(resolution);
161
195
  moduleInfo.moduleSideEffects = true;
162
196
  return resolution.id.includes(`.mjs${SENTRY_WRAPPED_ENTRY}`) ? resolution.id : `${resolutionIdPrefix}${resolution.id.concat(SENTRY_WRAPPED_ENTRY).concat(
163
- constructWrappedFunctionExportQuery(moduleInfo.exportedBindings, entrypointWrappedFunctions, debug)
197
+ constructWrappedFunctionExportQuery(
198
+ moduleInfo.exportedBindings,
199
+ experimental_entrypointWrappedFunctions,
200
+ debug
201
+ )
164
202
  ).concat(QUERY_END_INDICATOR)}`;
165
203
  }
166
204
  return null;
@@ -380,9 +418,12 @@ const module = defineNuxtModule({
380
418
  setup(moduleOptionsParam, nuxt) {
381
419
  const moduleOptions = {
382
420
  ...moduleOptionsParam,
383
- dynamicImportForServerEntry: moduleOptionsParam.dynamicImportForServerEntry !== false,
384
- // default: true
385
- entrypointWrappedFunctions: moduleOptionsParam.entrypointWrappedFunctions || ["default", "handler", "server"]
421
+ autoInjectServerSentry: moduleOptionsParam.autoInjectServerSentry,
422
+ experimental_entrypointWrappedFunctions: moduleOptionsParam.experimental_entrypointWrappedFunctions || [
423
+ "default",
424
+ "handler",
425
+ "server"
426
+ ]
386
427
  };
387
428
  const moduleDirResolver = createResolver(import.meta.url);
388
429
  const buildDirResolver = createResolver(nuxt.options.buildDir);
@@ -407,13 +448,16 @@ const module = defineNuxtModule({
407
448
  }
408
449
  const serverConfigFile = findDefaultSdkInitFile("server");
409
450
  if (serverConfigFile) {
410
- if (moduleOptions.dynamicImportForServerEntry === false) {
451
+ if (moduleOptions.autoInjectServerSentry !== "experimental_dynamic-import") {
411
452
  addPluginTemplate({
412
453
  mode: "server",
413
454
  filename: "sentry-server-config.mjs",
414
- getContents: () => `import "${buildDirResolver.resolve(`/${serverConfigFile}`)}"
415
- import { defineNuxtPlugin } from "#imports"
416
- export default defineNuxtPlugin(() => {})`
455
+ getContents: () => (
456
+ // 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.
457
+ `import "${buildDirResolver.resolve(`/${serverConfigFile}`)}";
458
+ import { defineNuxtPlugin } from "#imports";
459
+ export default defineNuxtPlugin(() => {});`
460
+ )
417
461
  });
418
462
  }
419
463
  addServerPlugin(moduleDirResolver.resolve("./runtime/plugins/sentry.server"));
@@ -426,11 +470,24 @@ export default defineNuxtPlugin(() => {})`
426
470
  if (nitro.options.dev) {
427
471
  consoleSandbox(() => {
428
472
  console.log(
429
- "[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."
473
+ "[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."
430
474
  );
431
475
  });
432
476
  }
433
- if (moduleOptions.dynamicImportForServerEntry === false) {
477
+ consoleSandbox(() => {
478
+ const serverDir = nitro.options.output.serverDir;
479
+ if (serverDir.includes(".netlify") || !!process.env.NETLIFY) {
480
+ console.warn(
481
+ "[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/"
482
+ );
483
+ }
484
+ if (serverDir.includes(".vercel") || !!process.env.VERCEL) {
485
+ console.warn(
486
+ "[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/"
487
+ );
488
+ }
489
+ });
490
+ if (moduleOptions.autoInjectServerSentry !== "experimental_dynamic-import") {
434
491
  addServerConfigToBuild(moduleOptions, nuxt, nitro, serverConfigFile);
435
492
  if (moduleOptions.debug) {
436
493
  const serverDirResolver = createResolver(nitro.options.output.serverDir);
@@ -442,7 +499,11 @@ export default defineNuxtPlugin(() => {})`
442
499
  );
443
500
  });
444
501
  }
445
- } else {
502
+ }
503
+ if (moduleOptions.autoInjectServerSentry === "top-level-import") {
504
+ addSentryTopImport(moduleOptions, nitro);
505
+ }
506
+ if (moduleOptions.autoInjectServerSentry === "experimental_dynamic-import") {
446
507
  addDynamicImportEntryFileWrapper(nitro, serverConfigFile, moduleOptions);
447
508
  if (moduleOptions.debug) {
448
509
  consoleSandbox(() => {
@@ -1,9 +1,12 @@
1
+ import { patchEventHandler } from "@sentry-internal/nitro-utils";
2
+ import { GLOBAL_OBJ, flush, getClient, logger, vercelWaitUntil } from "@sentry/core";
1
3
  import * as Sentry from "@sentry/node";
2
4
  import { H3Error } from "h3";
3
5
  import { defineNitroPlugin } from "nitropack/runtime";
4
6
  import { addSentryTracingMetaTags, extractErrorContext } from "../utils.js";
5
7
  export default defineNitroPlugin((nitroApp) => {
6
- nitroApp.hooks.hook("error", (error, errorContext) => {
8
+ nitroApp.h3App.handler = patchEventHandler(nitroApp.h3App.handler);
9
+ nitroApp.hooks.hook("error", async (error, errorContext) => {
7
10
  if (error instanceof H3Error) {
8
11
  if (error.statusCode >= 300 && error.statusCode < 500) {
9
12
  return;
@@ -21,8 +24,28 @@ export default defineNitroPlugin((nitroApp) => {
21
24
  captureContext: { contexts: { nuxt: structuredContext } },
22
25
  mechanism: { handled: false }
23
26
  });
27
+ await flushIfServerless();
24
28
  });
25
29
  nitroApp.hooks.hook("render:html", (html) => {
26
30
  addSentryTracingMetaTags(html.head);
27
31
  });
28
32
  });
33
+ async function flushIfServerless() {
34
+ const isServerless = !!process.env.LAMBDA_TASK_ROOT || !!process.env.VERCEL || !!process.env.NETLIFY;
35
+ if (GLOBAL_OBJ[Symbol.for("@vercel/request-context")]) {
36
+ vercelWaitUntil(flushWithTimeout());
37
+ } else if (isServerless) {
38
+ await flushWithTimeout();
39
+ }
40
+ }
41
+ async function flushWithTimeout() {
42
+ const sentryClient = getClient();
43
+ const isDebug = sentryClient ? sentryClient.getOptions().debug : false;
44
+ try {
45
+ isDebug && logger.log("Flushing events...");
46
+ await flush(2e3);
47
+ isDebug && logger.log("Done flushing events");
48
+ } catch (e) {
49
+ isDebug && logger.log("Error while flushing events:\n", e);
50
+ }
51
+ }
@@ -0,0 +1,3 @@
1
+ declare const _default: import("unbuild").BuildConfig[];
2
+ export default _default;
3
+ //# sourceMappingURL=build.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.config.d.ts","sourceRoot":"","sources":["../../build.config.ts"],"names":[],"mappings":";AAGA,wBAGG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"piniaIntegration.d.ts","sourceRoot":"","sources":["../../../../src/client/piniaIntegration.ts"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;oDAAuC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../../src/client/sdk.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAUzE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vueIntegration.d.ts","sourceRoot":"","sources":["../../../../src/client/vueIntegration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,KAAK,OAAO,GAAG,IAAI,CACjB,qBAAqB,EACnB,KAAK,GACL,KAAK,GAEL,OAAO,GAEP,SAAS,GAET,iBAAiB,CACpB,CAAC;AAKF,MAAM,MAAM,+BAA+B,GAAG;IAAE,gCAAgC,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAM7F;;GAEG;AACH,eAAO,MAAM,cAAc,uEAQzB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-build.d.ts","sourceRoot":"","sources":["../../../../src/common/debug-build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
@@ -90,21 +90,34 @@ export type SentryNuxtModuleOptions = {
90
90
  */
91
91
  debug?: boolean;
92
92
  /**
93
- * Wraps the server entry file with a dynamic `import()`. This will make it possible to preload Sentry and register
94
- * necessary hooks before other code runs. (Node docs: https://nodejs.org/api/module.html#enabling)
95
93
  *
96
- * If this option is `false`, the Sentry SDK won't wrap the server entry file with `import()`. Not wrapping the
97
- * server entry file will disable Sentry on the server-side. When you set this option to `false`, make sure
98
- * to add the Sentry server config with the node `--import` CLI flag to enable Sentry on the server-side.
94
+ * Enables (partial) server tracing by automatically injecting Sentry for environments where modifying the node option `--import` is not possible.
99
95
  *
100
- * **DO NOT** add the node CLI flag `--import` in your node start script, when `dynamicImportForServerEntry` is set to `true` (default).
96
+ * **DO NOT** add the node CLI flag `--import` in your node start script, when auto-injecting Sentry.
101
97
  * This would initialize Sentry twice on the server-side and this leads to unexpected issues.
102
98
  *
103
- * @default true
99
+ * ---
100
+ *
101
+ * **"top-level-import"**
102
+ *
103
+ * Enabling basic server tracing with top-level import can be used for environments where modifying the node option `--import` is not possible.
104
+ * However, enabling this option only supports limited tracing instrumentation. Only http traces will be collected (but no database-specific traces etc.).
105
+ *
106
+ * If `"top-level-import"` is enabled, the Sentry SDK will import the Sentry server config at the top of the server entry file to load the SDK on the server.
107
+ *
108
+ * ---
109
+ * **"experimental_dynamic-import"**
110
+ *
111
+ * Wraps the server entry file with a dynamic `import()`. This will make it possible to preload Sentry and register
112
+ * necessary hooks before other code runs. (Node docs: https://nodejs.org/api/module.html#enabling)
113
+ *
114
+ * If `"experimental_dynamic-import"` is enabled, the Sentry SDK wraps the server entry file with `import()`.
115
+ *
116
+ * @default undefined
104
117
  */
105
- dynamicImportForServerEntry?: boolean;
118
+ autoInjectServerSentry?: 'top-level-import' | 'experimental_dynamic-import';
106
119
  /**
107
- * By default—unless you configure `dynamicImportForServerEntry: false`—the SDK will try to wrap your Nitro server entrypoint
120
+ * When `autoInjectServerSentry` is set to `"experimental_dynamic-import"`, the SDK will wrap your Nitro server entrypoint
108
121
  * with a dynamic `import()` to ensure all dependencies can be properly instrumented. Any previous exports from the entrypoint are still exported.
109
122
  * Most exports of the server entrypoint are serverless functions and those are wrapped by Sentry. Other exports stay as-is.
110
123
  *
@@ -114,7 +127,7 @@ export type SentryNuxtModuleOptions = {
114
127
  *
115
128
  * @default ['default', 'handler', 'server']
116
129
  */
117
- entrypointWrappedFunctions?: string[];
130
+ experimental_entrypointWrappedFunctions?: string[];
118
131
  /**
119
132
  * Options to be passed directly to the Sentry Rollup Plugin (`@sentry/rollup-plugin`) and Sentry Vite Plugin (`@sentry/vite-plugin`) that ship with the Sentry Nuxt SDK.
120
133
  * You can use this option to override any options the SDK passes to the Vite (for Nuxt) and Rollup (for Nitro) plugin.
@@ -0,0 +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;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;;;;;;;;WASG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QAEhC;;;;;;;WAOG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QAEhC;;;;;;;WAOG;QACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;KACnD,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,iBAAiB,CAAC;IAE5C;;;OAGG;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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/index.client.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../../src/index.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAIjD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAG/B,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,uBAAuB,GAAG,SAAS,CAAC,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AACrH,MAAM,CAAC,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,SAAS,CAAC,uBAAuB,CAAC;AACvF,MAAM,CAAC,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,SAAS,CAAC,uBAAuB,CAAC;AACvF,MAAM,CAAC,OAAO,CAAC,MAAM,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,WAAW,EAAE,CAAC;AACjF,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB,EAAE,WAAW,CAAC;AACrD,MAAM,CAAC,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,SAAS,CAAC,aAAa,CAAC;AAEnE,MAAM,CAAC,OAAO,CAAC,MAAM,OAAO,EAAE,OAAO,SAAS,CAAC,OAAO,GAAG,OAAO,SAAS,CAAC,OAAO,CAAC"}
@@ -0,0 +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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.client.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/plugins/sentry.client.ts"],"names":[],"mappings":";AAiCA,wBA0CG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.server.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/plugins/sentry.server.ts"],"names":[],"mappings":";AAQA,wBAmCG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/runtime/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,OAAO,EAAE,MAAM,cAAc,CAAC;AAG3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,KAAK,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAmB/E;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,IAAI,CAMlF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAyBP"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../../src/server/sdk.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAe,MAAM,cAAc,CAAC;AASxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAezE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,uBAAuB,GAAG,cAAc,CAkB7F;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,cAAc,CAY3F;AAiBD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,uBAAuB,GAC/B,uBAAuB,CAAC,wBAAwB,CAAC,CAYnD;AAED;;GAEG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQ5D"}
@@ -8,6 +8,12 @@ import type { SentryNuxtModuleOptions } from '../common/types';
8
8
  * 2. Copying the file to the `.output` directory after the build process is finished.
9
9
  */
10
10
  export declare function addServerConfigToBuild(moduleOptions: SentryNuxtModuleOptions, nuxt: Nuxt, nitro: Nitro, serverConfigFile: string): void;
11
+ /**
12
+ * Adds the Sentry server config import at the top of the server entry file to load the SDK on the server.
13
+ * This is necessary for environments where modifying the node option `--import` is not possible.
14
+ * However, only limited tracing instrumentation is supported when doing this.
15
+ */
16
+ export declare function addSentryTopImport(moduleOptions: SentryNuxtModuleOptions, nitro: Nitro): void;
11
17
  /**
12
18
  * This function modifies the Rollup configuration to include a plugin that wraps the entry file with a dynamic import (`import()`)
13
19
  * and adds the Sentry server config with the static `import` declaration.
@@ -15,5 +21,5 @@ export declare function addServerConfigToBuild(moduleOptions: SentryNuxtModuleOp
15
21
  * With this, the Sentry server config can be loaded before all other modules of the application (which is needed for import-in-the-middle).
16
22
  * See: https://nodejs.org/api/module.html#enabling
17
23
  */
18
- export declare function addDynamicImportEntryFileWrapper(nitro: Nitro, serverConfigFile: string, moduleOptions: Omit<SentryNuxtModuleOptions, 'entrypointWrappedFunctions'> & Required<Pick<SentryNuxtModuleOptions, 'entrypointWrappedFunctions'>>): void;
24
+ export declare function addDynamicImportEntryFileWrapper(nitro: Nitro, serverConfigFile: string, moduleOptions: Omit<SentryNuxtModuleOptions, 'experimental_entrypointWrappedFunctions'> & Required<Pick<SentryNuxtModuleOptions, 'experimental_entrypointWrappedFunctions'>>): void;
19
25
  //# sourceMappingURL=addServerConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addServerConfig.d.ts","sourceRoot":"","sources":["../../../../src/vite/addServerConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAc/D;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,uBAAuB,EACtC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,MAAM,GACvB,IAAI,CA8CN;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,uBAAuB,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CA0C7F;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,IAAI,CAAC,uBAAuB,EAAE,yCAAyC,CAAC,GACrF,QAAQ,CAAC,IAAI,CAAC,uBAAuB,EAAE,yCAAyC,CAAC,CAAC,GACnF,IAAI,CAkBN"}
@@ -0,0 +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,IAAI,EAAE,IAAI,GAAG,IAAI,CA2CxF;AASD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,uBAAuB,EACtC,sBAAsB,EAAE,OAAO,GAC9B,uBAAuB,GAAG,yBAAyB,CAwCrD;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"}
@@ -3,6 +3,10 @@
3
3
  * The sentry.server.config file is prioritized over the instrument.server file.
4
4
  */
5
5
  export declare function findDefaultSdkInitFile(type: 'server' | 'client'): string | undefined;
6
+ /**
7
+ * Extracts the filename from a node command with a path.
8
+ */
9
+ export declare function getFilenameFromNodeStartCommand(nodeCommand: string): string | null;
6
10
  export declare const SENTRY_WRAPPED_ENTRY = "?sentry-query-wrapped-entry";
7
11
  export declare const SENTRY_WRAPPED_FUNCTIONS = "?sentry-query-wrapped-functions=";
8
12
  export declare const SENTRY_REEXPORTED_FUNCTIONS = "?sentry-query-reexported-functions=";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/vite/utils.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAkBpF;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIlF;AAED,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAC3E,eAAO,MAAM,2BAA2B,wCAAwC,CAAC;AACjF,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED;;;;;GAKG;AACH,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA+B5G;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,EACjD,0BAA0B,EAAE,MAAM,EAAE,EACpC,KAAK,CAAC,EAAE,OAAO,GACd,MAAM,CAmCR;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAsBxF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/nuxt",
3
- "version": "8.42.0",
3
+ "version": "8.44.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,16 +43,17 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@nuxt/kit": "^3.13.2",
46
- "@sentry/browser": "8.42.0",
47
- "@sentry/core": "8.42.0",
48
- "@sentry/node": "8.42.0",
49
- "@sentry/opentelemetry": "8.42.0",
50
- "@sentry/rollup-plugin": "2.22.6",
46
+ "@sentry/browser": "8.44.0",
47
+ "@sentry/core": "8.44.0",
48
+ "@sentry/node": "8.44.0",
49
+ "@sentry/opentelemetry": "8.44.0",
50
+ "@sentry/rollup-plugin": "2.22.7",
51
51
  "@sentry/vite-plugin": "2.22.6",
52
- "@sentry/vue": "8.42.0"
52
+ "@sentry/vue": "8.44.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@nuxt/module-builder": "^0.8.4",
56
+ "@sentry-internal/nitro-utils": "8.44.0",
56
57
  "nuxt": "^3.13.2"
57
58
  },
58
59
  "scripts": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"sentry.client.js","sources":["../../../../src/runtime/plugins/sentry.client.ts"],"sourcesContent":["import { GLOBAL_OBJ, getClient } from '@sentry/core';\nimport { browserTracingIntegration, vueIntegration } from '@sentry/vue';\nimport { defineNuxtPlugin } from 'nuxt/app';\nimport type { GlobalObjWithIntegrationOptions } from '../../client/vueIntegration';\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(\n vueIntegration({\n // We pick up the options from the \"fake\" vueIntegration exported by the SDK.\n ...(GLOBAL_OBJ as GlobalObjWithIntegrationOptions)._sentryNuxtVueIntegrationOptions,\n app: vueApp,\n attachErrorHandler: false,\n }),\n );\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","GLOBAL_OBJ","reportNuxtError"],"mappings":";;;;;AAMA;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;AACnC,UAAUE,kBAAc,CAAC;AACzB;AACA,YAAY,GAAG,CAACC,eAAW,GAAoC,gCAAgC;AAC/F,YAAY,GAAG,EAAE,MAAM;AACvB,YAAY,kBAAkB,EAAE,KAAK;AACrC,WAAW,CAAC;AACZ,SAAS;AACT;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 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/runtime/utils.ts"],"sourcesContent":["import type { ClientOptions, Context } from '@sentry/core';\nimport { captureException, dropUndefinedKeys, getClient, getTraceMetaTags } from '@sentry/core';\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":";;;;AAOA;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,IAAI,IAAI,YAAY,CAAC,KAAK,EAAE;AAC5B,MAAM,iBAAiB,CAAC,MAAA,GAAS,YAAY,CAAC,KAAK,CAAC,OAAQ,IAAG,SAAS;AACxE,MAAM,iBAAiB,CAAC,IAAA,GAAO,YAAY,CAAC,KAAK,CAAC,KAAM,IAAG,SAAS;AACpE;;AAEA,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;AAC1C,MAAM,iBAAiB,CAAC,IAAK,GAAE,YAAY,CAAC,IAAA,IAAQ,SAAS;AAC7D;AACA;;AAEA,EAAE,OAAOA,sBAAiB,CAAC,iBAAiB,CAAC;AAC7C;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,CAAC,IAAI,EAAuC;AACpF,EAAE,MAAM,QAAA,GAAWC,qBAAgB,EAAE;;AAErC,EAAE,IAAI,QAAQ,EAAE;AAChB,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AACvB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC;;AAIhC,EAAS;AACT,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAA,EAAO,GAAE,OAAO;;AAE3C,EAAE,MAAM,QAAQ,GAA4B;AAC5C,IAAI,IAAI;AACR;AACA,GAAG;;AAEH,EAAE,IAAI,QAAA,IAAY,QAAQ,CAAC,MAAM,EAAE;AACnC,IAAI,MAAM,YAAA,GAAeC,cAAS,EAAE;AACpC,IAAI,MAAM,aAAA,GAAgB,YAAA,IAAgB,YAAY,CAAC,UAAU,EAAG,KAAiC,IAAI;;AAEzG;AACA,IAAI,IAAI,aAAc,IAAG,aAAa,CAAC,WAAY,IAAG,QAAQ,CAAC,MAAO,KAAI,KAAK,EAAE;AACjF,MAAM,QAAQ,CAAC,SAAA,GAAY,QAAQ,CAAC,MAAM;AAC1C;AACA;;AAEA;AACA,EAAE,UAAU,CAAC,MAAM;AACnB,IAAIC,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 +0,0 @@
1
- {"version":3,"file":"sentry.client.js","sources":["../../../../src/runtime/plugins/sentry.client.ts"],"sourcesContent":["import { GLOBAL_OBJ, getClient } from '@sentry/core';\nimport { browserTracingIntegration, vueIntegration } from '@sentry/vue';\nimport { defineNuxtPlugin } from 'nuxt/app';\nimport type { GlobalObjWithIntegrationOptions } from '../../client/vueIntegration';\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(\n vueIntegration({\n // We pick up the options from the \"fake\" vueIntegration exported by the SDK.\n ...(GLOBAL_OBJ as GlobalObjWithIntegrationOptions)._sentryNuxtVueIntegrationOptions,\n app: vueApp,\n attachErrorHandler: false,\n }),\n );\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":[],"mappings":";;;;;AAMA;AACA;AACA;;AAyBA,sBAAe,gBAAgB,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,GAAe,SAAS,EAAE;;AAEtC,MAAM,IAAI,YAAA,IAAgB,SAAU,IAAG,OAAO,EAAE;AAChD,QAAQ,YAAY,CAAC,cAAc;AACnC,UAAU,yBAAyB,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,GAAe,SAAS,EAAE;;AAEtC,MAAM,IAAI,YAAY,EAAE;AACxB;AACA;AACA;AACA,QAAQ,YAAY,CAAC,cAAc;AACnC,UAAU,cAAc,CAAC;AACzB;AACA,YAAY,GAAG,CAAC,UAAW,GAAoC,gCAAgC;AAC/F,YAAY,GAAG,EAAE,MAAM;AACvB,YAAY,kBAAkB,EAAE,KAAK;AACrC,WAAW,CAAC;AACZ,SAAS;AACT;AACA,KAAK,CAAC;;AAEN,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS;AACvC,MAAM,eAAe,CAAC,EAAE,KAAA,EAAO,CAAC;AAChC,KAAK,CAAC;;AAEN,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,KAAK;AACzD,MAAM,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAK,EAAC,CAAC;AAChD,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC;;;;"}
@@ -1 +0,0 @@
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":[],"mappings":";;;;;AAMA,sBAAe,iBAAiB,CAAC,QAAA,IAAY;AAC7C,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK;AACxD;AACA,IAAI,IAAI,KAAM,YAAW,OAAO,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,GAAA,mBAAA,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,IAAA,wBAAA,CAAA,IAAA,CAAA,IAAA,CAAA;AACA,GAAA,CAAA;AACA,CAAA,CAAA;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/runtime/utils.ts"],"sourcesContent":["import type { ClientOptions, Context } from '@sentry/core';\nimport { captureException, dropUndefinedKeys, getClient, getTraceMetaTags } from '@sentry/core';\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":[],"mappings":";;AAOA;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,IAAI,IAAI,YAAY,CAAC,KAAK,EAAE;AAC5B,MAAM,iBAAiB,CAAC,MAAA,GAAS,YAAY,CAAC,KAAK,CAAC,OAAQ,IAAG,SAAS;AACxE,MAAM,iBAAiB,CAAC,IAAA,GAAO,YAAY,CAAC,KAAK,CAAC,KAAM,IAAG,SAAS;AACpE;;AAEA,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;AAC1C,MAAM,iBAAiB,CAAC,IAAK,GAAE,YAAY,CAAC,IAAA,IAAQ,SAAS;AAC7D;AACA;;AAEA,EAAE,OAAO,iBAAiB,CAAC,iBAAiB,CAAC;AAC7C;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,CAAC,IAAI,EAAuC;AACpF,EAAE,MAAM,QAAA,GAAW,gBAAgB,EAAE;;AAErC,EAAE,IAAI,QAAQ,EAAE;AAChB,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AACvB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC;;AAIhC,EAAS;AACT,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAA,EAAO,GAAE,OAAO;;AAE3C,EAAE,MAAM,QAAQ,GAA4B;AAC5C,IAAI,IAAI;AACR;AACA,GAAG;;AAEH,EAAE,IAAI,QAAA,IAAY,QAAQ,CAAC,MAAM,EAAE;AACnC,IAAI,MAAM,YAAA,GAAe,SAAS,EAAE;AACpC,IAAI,MAAM,aAAA,GAAgB,YAAA,IAAgB,YAAY,CAAC,UAAU,EAAG,KAAiC,IAAI;;AAEzG;AACA,IAAI,IAAI,aAAc,IAAG,aAAa,CAAC,WAAY,IAAG,QAAQ,CAAC,MAAO,KAAI,KAAK,EAAE;AACjF,MAAM,QAAQ,CAAC,SAAA,GAAY,QAAQ,CAAC,MAAM;AAC1C;AACA;;AAEA;AACA,EAAE,UAAU,CAAC,MAAM;AACnB,IAAI,gBAAgB,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 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"piniaIntegration.d.ts","sourceRoot":"","sources":["../../../src/client/piniaIntegration.ts"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;oDAAuC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/client/sdk.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAUzE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vueIntegration.d.ts","sourceRoot":"","sources":["../../../src/client/vueIntegration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,KAAK,OAAO,GAAG,IAAI,CACjB,qBAAqB,EACnB,KAAK,GACL,KAAK,GAEL,OAAO,GAEP,SAAS,GAET,iBAAiB,CACpB,CAAC;AAKF,MAAM,MAAM,+BAA+B,GAAG;IAAE,gCAAgC,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAM7F;;GAEG;AACH,eAAO,MAAM,cAAc,uEAQzB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-build.d.ts","sourceRoot":"","sources":["../../../src/common/debug-build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
@@ -1 +0,0 @@
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;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;;;;;;;;WASG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QAEhC;;;;;;;WAOG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QAEhC;;;;;;;WAOG;QACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;KACnD,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,iBAAiB,CAAC;IAE5C;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;;;;;;;;OAYG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;;;;;;;;;OAUG;IACH,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtC;;;;;OAKG;IACH,mCAAmC,CAAC,EAAE,yBAAyB,GAAG,uBAAuB,CAAC;CAC3F,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../src/index.client.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../src/index.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAIjD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAG/B,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,uBAAuB,GAAG,SAAS,CAAC,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AACrH,MAAM,CAAC,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,SAAS,CAAC,uBAAuB,CAAC;AACvF,MAAM,CAAC,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,SAAS,CAAC,uBAAuB,CAAC;AACvF,MAAM,CAAC,OAAO,CAAC,MAAM,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,WAAW,EAAE,CAAC;AACjF,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB,EAAE,WAAW,CAAC;AACrD,MAAM,CAAC,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,SAAS,CAAC,aAAa,CAAC;AAEnE,MAAM,CAAC,OAAO,CAAC,MAAM,OAAO,EAAE,OAAO,SAAS,CAAC,OAAO,GAAG,OAAO,SAAS,CAAC,OAAO,CAAC"}
@@ -1 +0,0 @@
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,wBA4GG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sentry.client.d.ts","sourceRoot":"","sources":["../../../../src/runtime/plugins/sentry.client.ts"],"names":[],"mappings":";AAiCA,wBA0CG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sentry.server.d.ts","sourceRoot":"","sources":["../../../../src/runtime/plugins/sentry.server.ts"],"names":[],"mappings":";AAMA,wBA+BG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/runtime/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,OAAO,EAAE,MAAM,cAAc,CAAC;AAG3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,KAAK,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAmB/E;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,IAAI,CAMlF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAyBP"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/server/sdk.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAe,MAAM,cAAc,CAAC;AASxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAezE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,uBAAuB,GAAG,cAAc,CAkB7F;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,cAAc,CAY3F;AAiBD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,uBAAuB,GAC/B,uBAAuB,CAAC,wBAAwB,CAAC,CAYnD;AAED;;GAEG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQ5D"}