mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
dae438dc0d
Next.js printed a stack frame that does not exist for an error whose message ends with text that looks like a file location. A logged connection failure read `at <unknown> (Error: connect ECONNREFUSED ::1:45999)` in front of its real frames. `stacktrace-parser` tries five patterns on every line, and the pattern for JavaScriptCore makes the `<name>@` prefix optional. That pattern `:<line>:<column>`, and a line of an error message can end that way. A JavaScriptCore frame always holds `@`, also at the top level, so the prefix is not optional in a real stack. The patch for `stacktrace-parser` now requires that prefix. A line of a message no longer becomes a frame, and every JavaScriptCore frame still parses, including one whose path holds a space. A Turbopack build error puts the file and the position of the error in its message, and the parser read that line as a frame as well. That frame is gone now, and the location stays in the message. The snapshots of the build errors record the change.
41 lines
1.9 KiB
Diff
41 lines
1.9 KiB
Diff
diff --git a/dist/stack-trace-parser.cjs.js b/dist/stack-trace-parser.cjs.js
|
|
index 50c63025c622ebe479e07544bd796c2d3922d4b8..d704100cc59b6c47db5ad67ecd2662c99ecb62da 100644
|
|
--- a/dist/stack-trace-parser.cjs.js
|
|
+++ b/dist/stack-trace-parser.cjs.js
|
|
@@ -20,7 +20,7 @@ function parse(stackString) {
|
|
return stack;
|
|
}, []);
|
|
}
|
|
-var chromeRe = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
|
|
+var chromeRe = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|webpack-internal|rsc|about|turbopack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
|
|
var chromeEvalRe = /\((\S*)(?::(\d+))(?::(\d+))\)/;
|
|
|
|
function parseChrome(line) {
|
|
@@ -54,7 +54,7 @@ function parseChrome(line) {
|
|
};
|
|
}
|
|
|
|
-var winjsRe = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
+var winjsRe = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|webpack-internal|rsc|about|turbopack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
|
|
function parseWinjs(line) {
|
|
var parts = winjsRe.exec(line);
|
|
@@ -72,7 +72,7 @@ function parseWinjs(line) {
|
|
};
|
|
}
|
|
|
|
-var geckoRe = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
+var geckoRe = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|webpack-internal|rsc|about|turbopack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
var geckoEvalRe = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
|
|
|
|
function parseGecko(line) {
|
|
@@ -101,7 +101,7 @@ function parseGecko(line) {
|
|
};
|
|
}
|
|
|
|
-var javaScriptCoreRe = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;
|
|
+var javaScriptCoreRe = /^\s*([^@]*)(?:\((.*?)\))?@(\S.*?):(\d+)(?::(\d+))?\s*$/i;
|
|
|
|
function parseJSC(line) {
|
|
var parts = javaScriptCoreRe.exec(line);
|