File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
next-devtools/dev-overlay
test/development/app-dir/owner-stack Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -214,9 +214,11 @@ export type DispatcherEvent =
214214 | RestartServerButtonAction
215215
216216const REACT_ERROR_STACK_BOTTOM_FRAME_REGEX =
217- // 1st group: v8
218- // 2nd group: SpiderMonkey, JavaScriptCore
219- / \s + ( a t r e a c t - s t a c k - b o t t o m - f r a m e .* ) | ( r e a c t - s t a c k - b o t t o m - f r a m e @ .* ) /
217+ // 1st group: new frame + v8
218+ // 2nd group: new frame + SpiderMonkey, JavaScriptCore
219+ // 3rd group: old frame + v8
220+ // 4th group: old frame + SpiderMonkey, JavaScriptCore
221+ / \s + ( a t O b j e c t \. r e a c t _ s t a c k _ b o t t o m _ f r a m e .* ) | ( r e a c t _ s t a c k _ b o t t o m _ f r a m e @ .* ) | ( a t r e a c t - s t a c k - b o t t o m - f r a m e .* ) | ( r e a c t - s t a c k - b o t t o m - f r a m e @ .* ) /
220222
221223// React calls user code starting from a special stack frame.
222224// The basic stack will be different if the same error location is hit again
Original file line number Diff line number Diff line change @@ -357,9 +357,14 @@ function parseAndSourceMap(
357357 // doesn't implement the name computation correctly.
358358 const errorName = computeErrorName ( error )
359359
360- let idx = unparsedStack . indexOf ( 'react-stack-bottom-frame ' )
360+ let idx = unparsedStack . indexOf ( 'react_stack_bottom_frame ' )
361361 if ( idx !== - 1 ) {
362362 idx = unparsedStack . lastIndexOf ( '\n' , idx )
363+ } else {
364+ idx = unparsedStack . indexOf ( 'react-stack-bottom-frame' )
365+ if ( idx !== - 1 ) {
366+ idx = unparsedStack . lastIndexOf ( '\n' , idx )
367+ }
363368 }
364369 if ( idx !== - 1 && ! showIgnoreListed ) {
365370 // Cut off everything after the bottom frame since it'll be React internals.
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ function normalizeBrowserConsoleStackTrace(trace: unknown) {
1010 return (
1111 trace
1212 // Removes React's internals i.e. incomplete ignore-listing
13- . split ( / a t r e a c t - s t a c k - b o t t o m - f r a m e .* / m) [ 0 ]
13+ . split (
14+ / a t ( r e a c t - s t a c k - b o t t o m - f r a m e | O b j e c t \. r e a c t _ s t a c k _ b o t t o m _ f r a m e ) .* / m
15+ ) [ 0 ]
1416 // Remove the location `()` part in every line of stack trace;
1517 . replace ( / \( .* \) / g, '' )
1618 // Remove the leading spaces in every line of stack trace;
You can’t perform that action at this time.
0 commit comments