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
e6ea4b75
Unverified
Commit
e6ea4b75
authored
May 02, 2025
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
May 02, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[build-sourcemaps] Include codeframes in prod when sourcemaps are enabled (#78710)
parent
9d71fe4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
patch-error-inspect.ts
packages/next/src/server/patch-error-inspect.ts
+9
-14
No files found.
packages/next/src/server/patch-error-inspect.ts
View file @
e6ea4b75
...
...
@@ -184,7 +184,6 @@ function getSourcemappedFrameIfPossible(
inspectOptions
:
util
.
InspectOptions
):
{
stack
:
IgnoreableStackFrame
// DEV only
code
:
string
|
null
}
{
const
sourceMapCacheEntry
=
sourceMapCache
.
get
(
frame
.
file
)
...
...
@@ -322,14 +321,11 @@ function getSourcemappedFrameIfPossible(
ignored
,
}
const
codeFrame
=
process
.
env
.
NODE_ENV
!==
'production'
?
getOriginalCodeFrame
(
originalFrame
,
sourceContent
,
inspectOptions
.
colors
)
:
null
const
codeFrame
=
getOriginalCodeFrame
(
originalFrame
,
sourceContent
,
inspectOptions
.
colors
)
return
{
stack
:
originalFrame
,
...
...
@@ -363,7 +359,7 @@ function parseAndSourceMap(
const
sourceMapCache
:
SourceMapCache
=
new
Map
()
let
sourceMappedStack
=
''
let
sourceFrame
DEV
:
null
|
string
=
null
let
sourceFrame
:
null
|
string
=
null
for
(
const
frame
of
unsourcemappedStack
)
{
if
(
frame
.
file
===
null
)
{
sourceMappedStack
+=
'
\
n'
+
frameToString
(
frame
)
...
...
@@ -376,13 +372,12 @@ function parseAndSourceMap(
)
if
(
process
.
env
.
NODE_ENV
!==
'production'
&&
sourcemappedFrame
.
code
!==
null
&&
sourceFrame
DEV
===
null
&&
sourceFrame
===
null
&&
// TODO: Is this the right choice?
!
sourcemappedFrame
.
stack
.
ignored
)
{
sourceFrame
DEV
=
sourcemappedFrame
.
code
sourceFrame
=
sourcemappedFrame
.
code
}
if
(
!
sourcemappedFrame
.
stack
.
ignored
)
{
// TODO: Consider what happens if every frame is ignore listed.
...
...
@@ -400,7 +395,7 @@ function parseAndSourceMap(
': '
+
error
.
message
+
sourceMappedStack
+
(
sourceFrame
DEV
!==
null
?
'
\
n'
+
sourceFrameDEV
:
''
)
(
sourceFrame
!==
null
?
'
\
n'
+
sourceFrame
:
''
)
)
}
...
...
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