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
379ba00c
Unverified
Commit
379ba00c
authored
Feb 11, 2026
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Feb 11, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused devtools code handling React without `use` (#89793)
parent
ae64f6cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
62 deletions
+15
-62
render-error.tsx
...ools/dev-overlay/container/runtime-error/render-error.tsx
+3
-14
get-error-by-type.ts
.../src/next-devtools/dev-overlay/utils/get-error-by-type.ts
+12
-48
No files found.
packages/next/src/next-devtools/dev-overlay/container/runtime-error/render-error.tsx
View file @
379ba00c
...
...
@@ -68,20 +68,9 @@ const RenderRuntimeError = ({ children, state, isAppDir }: Props) => {
return
}
let
mounted
=
true
getErrorByType
(
nextError
,
isAppDir
).
then
((
resolved
)
=>
{
if
(
mounted
)
{
// We don't care if the desired error changed while we were resolving,
// thus we're not tracking it using a ref. Once the work has been done,
// we'll store it.
setLookups
((
m
)
=>
({
...
m
,
[
resolved
.
id
]:
resolved
}))
}
})
return
()
=>
{
mounted
=
false
}
const
resolved
=
getErrorByType
(
nextError
,
isAppDir
)
// eslint-disable-next-line react-hooks/set-state-in-effect -- TODO: fetch-while-rendering
setLookups
((
m
)
=>
({
...
m
,
[
resolved
.
id
]:
resolved
}))
},
[
nextError
,
isAppDir
])
const
totalErrorCount
=
errors
.
length
...
...
packages/next/src/next-devtools/dev-overlay/utils/get-error-by-type.ts
View file @
379ba00c
...
...
@@ -8,9 +8,7 @@ export type ReadyRuntimeError = {
id
:
number
runtime
:
true
error
:
Error
&
{
environmentName
?:
string
}
frames
:
|
readonly
OriginalStackFrame
[]
|
(()
=>
Promise
<
readonly
OriginalStackFrame
[]
>
)
frames
:
()
=>
Promise
<
readonly
OriginalStackFrame
[]
>
type
:
'runtime'
|
'console'
|
'recoverable'
}
...
...
@@ -19,63 +17,29 @@ export const useFrames = (
):
readonly
OriginalStackFrame
[]
=>
{
if
(
!
error
)
return
[]
if
(
'use'
in
React
)
{
const
frames
=
error
.
frames
if
(
typeof
frames
!==
'function'
)
{
throw
new
Error
(
'Invariant: frames must be a function when the React version has React.use. This is a bug in Next.js.'
)
}
return
React
.
use
((
frames
as
()
=>
Promise
<
readonly
OriginalStackFrame
[]
>
)())
}
else
{
if
(
!
Array
.
isArray
(
error
.
frames
))
{
throw
new
Error
(
'Invariant: frames must be an array when the React version does not have React.use. This is a bug in Next.js.'
)
}
return
error
.
frames
}
const
frames
=
error
.
frames
return
React
.
use
(
frames
())
}
export
async
function
getErrorByType
(
export
function
getErrorByType
(
event
:
SupportedErrorEvent
,
isAppDir
:
boolean
):
Promise
<
ReadyRuntimeError
>
{
const
bas
eError
=
{
):
ReadyRuntimeError
{
const
readyRuntimeError
:
ReadyRuntim
eError
=
{
id
:
event
.
id
,
runtime
:
true
,
error
:
event
.
error
,
type
:
event
.
type
,
}
as
const
if
(
'use'
in
React
)
{
const
readyRuntimeError
:
ReadyRuntimeError
=
{
...
baseError
,
// createMemoizedPromise dedups calls to getOriginalStackFrames
frames
:
createMemoizedPromise
(
async
()
=>
{
return
await
getOriginalStackFrames
(
event
.
frames
,
getErrorSource
(
event
.
error
),
isAppDir
)
}),
}
return
readyRuntimeError
}
else
{
const
readyRuntimeError
:
ReadyRuntimeError
=
{
...
baseError
,
// createMemoizedPromise dedups calls to getOriginalStackFrames
frames
:
await
getOriginalStackFrames
(
// createMemoizedPromise dedups calls to getOriginalStackFrames
frames
:
createMemoizedPromise
(
async
()
=>
{
return
await
getOriginalStackFrames
(
event
.
frames
,
getErrorSource
(
event
.
error
),
isAppDir
),
}
return
readyRuntimeError
)
}),
}
return
readyRuntimeError
}
function
createMemoizedPromise
<
T
>
(
...
...
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