diff --git a/packages/browser/src/stack-parsers.ts b/packages/browser/src/stack-parsers.ts index e4c66755f232..bb9be84aee64 100644 --- a/packages/browser/src/stack-parsers.ts +++ b/packages/browser/src/stack-parsers.ts @@ -55,7 +55,7 @@ function createFrame(filename: string, func: string, lineno?: number, colno?: nu // Chromium based browsers: Chrome, Brave, new Opera, new Edge const chromeRegex = - /^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?(?:async )?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; + /^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; const chrome: StackLineParserFn = line => { @@ -91,7 +91,7 @@ export const chromeStackLineParser: StackLineParser = [CHROME_PRIORITY, chrome]; // generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js // We need this specific case for now because we want no other regex to match. const geckoREgex = - /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; + /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; const gecko: StackLineParserFn = line => { @@ -123,8 +123,7 @@ const gecko: StackLineParserFn = line => { export const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko]; -const winjsRegex = - /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i; +const winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i; const winjs: StackLineParserFn = line => { const parts = winjsRegex.exec(line);