@mushi-mushi/web 1.32.1 → 1.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5772,6 +5772,15 @@ var DEFAULT_EXCLUDE_ROUTES = [
5772
5772
  "/sso/*",
5773
5773
  "/auth/*"
5774
5774
  ];
5775
+ var STACK_FRAME_URL = /(?:^\s*at\s+(?:.*?\()?|@)([a-z][a-z0-9+.-]*:\/\/[^\s()]*?)(?::\d+){1,2}\)?\s*$/i;
5776
+ function scriptUrlFromStack(stack) {
5777
+ if (typeof stack !== "string" || stack.length === 0) return void 0;
5778
+ for (const line of stack.split("\n")) {
5779
+ const match = STACK_FRAME_URL.exec(line);
5780
+ if (match) return match[1];
5781
+ }
5782
+ return void 0;
5783
+ }
5775
5784
  function setupProactiveTriggers(callbacks, config = {}) {
5776
5785
  const cleanups = [];
5777
5786
  if (config.rageClick !== false) {
@@ -5926,6 +5935,7 @@ function setupProactiveTriggers(callbacks, config = {}) {
5926
5935
  const message = event.reason instanceof Error ? event.reason.message : String(event.reason);
5927
5936
  if (shouldDropCapturedError({
5928
5937
  message,
5938
+ filename: event.reason instanceof Error ? scriptUrlFromStack(event.reason.stack) : void 0,
5929
5939
  ignoreErrors: config.ignoreErrors,
5930
5940
  denyUrls: config.denyUrls,
5931
5941
  allowUrls: config.allowUrls
@@ -6041,7 +6051,7 @@ function createProactiveManager(config = {}) {
6041
6051
 
6042
6052
  // src/version.ts
6043
6053
  var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
6044
- var MUSHI_SDK_VERSION = "1.32.1" ;
6054
+ var MUSHI_SDK_VERSION = "1.32.2" ;
6045
6055
  function resolveReportAppVersion(config, environment) {
6046
6056
  if (config.appVersion) return config.appVersion;
6047
6057
  const vercelId = config.integrations?.vercel?.analyticsId;
@@ -7384,7 +7394,7 @@ function createInstance(config) {
7384
7394
  },
7385
7395
  async captureException(error, options) {
7386
7396
  const normalised = normaliseThrown(error);
7387
- const filename = typeof options?.metadata?.filename === "string" ? options.metadata.filename : void 0;
7397
+ const filename = typeof options?.metadata?.filename === "string" ? options.metadata.filename : scriptUrlFromStack(normalised.stack);
7388
7398
  if (shouldDropCapturedError({
7389
7399
  message: normalised.message,
7390
7400
  filename,