-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(error-overlay): correct module grouping #62206
Merged
Merged
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9753d27
fix(error-overlay): correct module groupping, hide useless frames
balazsorban44 fe88675
format
balazsorban44 0b2f678
revert filtering
balazsorban44 9553ace
tweak module group detection
balazsorban44 80d6f88
add/update tests
balazsorban44 087c8e5
Apply suggestions from code review
balazsorban44 972a5dd
fixes
balazsorban44 5e83460
revert
balazsorban44 a1b75c0
revert
balazsorban44 38c4ab6
group leading frames
balazsorban44 3622a23
improve `sourcePackage` detection, always return to client
balazsorban44 f30a4cb
fix css
balazsorban44 ad130bf
only show groups if "Show collapsed frames" was clicked
balazsorban44 30a1271
fix show
balazsorban44 242fcf4
send `sourcePackage` even if `originalStackFrameResponse` could not b…
balazsorban44 2581763
send `sourcePackage` in more cases
balazsorban44 bdb1875
Merge branch 'canary' into fix/hide-useless-lines-from-stack
balazsorban44 625142c
unify with Turbopack
balazsorban44 892e7fc
use traced file name when available
balazsorban44 ec08d8d
address review
balazsorban44 215788e
type tweaks
balazsorban44 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ import type { ReadyRuntimeError } from '../../helpers/getErrorByType' | |
import { noop as css } from '../../helpers/noop-template' | ||
import type { OriginalStackFrame } from '../../helpers/stack-frame' | ||
import { groupStackFramesByFramework } from '../../helpers/group-stack-frames-by-framework' | ||
import { CallStackFrame } from './CallStackFrame' | ||
import { GroupedStackFrames } from './GroupedStackFrames' | ||
import { ComponentStackFrameRow } from './ComponentStackFrameRow' | ||
|
||
|
@@ -64,21 +63,24 @@ const RuntimeError: React.FC<RuntimeErrorProps> = function RuntimeError({ | |
]) | ||
|
||
const stackFramesGroupedByFramework = React.useMemo( | ||
() => groupStackFramesByFramework(visibleCallStackFrames), | ||
[visibleCallStackFrames] | ||
() => groupStackFramesByFramework(allCallStackFrames), | ||
[allCallStackFrames] | ||
) | ||
|
||
const leadingFramesGroupedByFramework = React.useMemo( | ||
() => groupStackFramesByFramework(leadingFrames), | ||
[leadingFrames] | ||
) | ||
|
||
return ( | ||
<React.Fragment> | ||
{firstFrame ? ( | ||
<React.Fragment> | ||
<h2>Source</h2> | ||
{leadingFrames.map((frame, index) => ( | ||
<CallStackFrame | ||
key={`leading-frame-${index}-${all}`} | ||
frame={frame} | ||
/> | ||
))} | ||
<GroupedStackFrames | ||
groupedStackFrames={leadingFramesGroupedByFramework} | ||
show={all} | ||
/> | ||
<CodeFrame | ||
stackFrame={firstFrame.originalStackFrame!} | ||
codeFrame={firstFrame.originalCodeFrame!} | ||
|
@@ -103,7 +105,7 @@ const RuntimeError: React.FC<RuntimeErrorProps> = function RuntimeError({ | |
<h2>Call Stack</h2> | ||
<GroupedStackFrames | ||
groupedStackFrames={stackFramesGroupedByFramework} | ||
all={all} | ||
show={all} | ||
/> | ||
</React.Fragment> | ||
) : undefined} | ||
|
@@ -196,7 +198,7 @@ export const styles = css` | |
[data-nextjs-collapsed-call-stack-details] summary { | ||
display: flex; | ||
align-items: center; | ||
margin: var(--size-gap-double) 0; | ||
margin-bottom: var(--size-gap); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
list-style: none; | ||
} | ||
[data-nextjs-collapsed-call-stack-details] summary::-webkit-details-marker { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should respect the main "Hide/Show collapsed frames" and should not show grouped stackframes at all when collapsed