Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
71cb06d0
Unverified
Commit
71cb06d0
authored
Feb 27, 2025
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Feb 27, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev-overlay] Discriminate stack frame settled typed (#76517)
parent
a606ff7e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
17 deletions
+32
-17
call-stack-frame.stories.tsx
.../components/call-stack-frame/call-stack-frame.stories.tsx
+1
-1
call-stack.stories.tsx
...ay/ui/components/errors/call-stack/call-stack.stories.tsx
+1
-1
stack-frame.ts
.../client/components/react-dev-overlay/utils/stack-frame.ts
+30
-15
No files found.
packages/next/src/client/components/react-dev-overlay/ui/components/call-stack-frame/call-stack-frame.stories.tsx
View file @
71cb06d0
...
...
@@ -32,7 +32,7 @@ const frame = {
lineNumber
:
10
,
column
:
5
,
},
error
:
false
,
error
:
false
as
const
,
reason
:
null
,
external
:
false
,
ignored
:
false
,
...
...
packages/next/src/client/components/react-dev-overlay/ui/components/errors/call-stack/call-stack.stories.tsx
View file @
71cb06d0
...
...
@@ -33,7 +33,7 @@ const frame = {
column
:
5
,
},
originalCodeFrame
:
'export default function MyComponent() {'
,
error
:
false
,
error
:
false
as
const
,
reason
:
null
,
external
:
false
,
ignored
:
false
,
...
...
packages/next/src/client/components/react-dev-overlay/utils/stack-frame.ts
View file @
71cb06d0
...
...
@@ -8,21 +8,34 @@ import {
isWebpackInternalResource
,
formatFrameSourceFile
,
}
from
'./webpack-module-path'
export
interface
OriginalStackFrame
extends
OriginalStackFrameResponse
{
error
:
boolean
reason
:
string
|
null
export
interface
ResolvedOriginalStackFrame
extends
OriginalStackFrameResponse
{
error
:
false
reason
:
null
external
:
boolean
ignored
:
boolean
sourceStackFrame
:
StackFrame
}
export
interface
RejectedOriginalStackFrame
extends
OriginalStackFrameResponse
{
error
:
true
reason
:
string
external
:
boolean
ignored
:
boolean
sourceStackFrame
:
StackFrame
}
export
type
OriginalStackFrame
=
|
ResolvedOriginalStackFrame
|
RejectedOriginalStackFrame
function
getOriginalStackFrame
(
source
:
StackFrame
,
response
:
OriginalStackFrameResponseResult
):
Promise
<
OriginalStackFrame
>
{
async
function
_getOriginalStackFrame
():
Promise
<
OriginalStackFrame
>
{
async
function
_getOriginalStackFrame
():
Promise
<
Resolved
OriginalStackFrame
>
{
if
(
response
.
status
===
'rejected'
)
{
return
Promise
.
reject
(
new
Error
(
response
.
reason
)
)
throw
new
Error
(
response
.
reason
)
}
const
body
:
OriginalStackFrameResponse
=
response
.
value
...
...
@@ -53,16 +66,18 @@ function getOriginalStackFrame(
})
}
return
_getOriginalStackFrame
().
catch
((
err
:
Error
)
=>
({
error
:
true
,
reason
:
err
?.
message
??
err
?.
toString
()
??
'Unknown Error'
,
external
:
false
,
sourceStackFrame
:
source
,
originalStackFrame
:
null
,
originalCodeFrame
:
null
,
sourcePackage
:
null
,
ignored
:
false
,
}))
return
_getOriginalStackFrame
().
catch
(
(
err
:
Error
):
RejectedOriginalStackFrame
=>
({
error
:
true
,
reason
:
err
?.
message
??
err
?.
toString
()
??
'Unknown Error'
,
external
:
false
,
sourceStackFrame
:
source
,
originalStackFrame
:
null
,
originalCodeFrame
:
null
,
sourcePackage
:
null
,
ignored
:
false
,
})
)
}
export
async
function
getOriginalStackFrames
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment