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
62f0d467
Unverified
Commit
62f0d467
authored
Apr 30, 2026
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Apr 30, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only log partytown setup error once (#93378)
parent
acb41ed6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
41 deletions
+24
-41
lib.rs
crates/next-error-code-swc-plugin/src/lib.rs
+0
-1
fatal-error.ts
packages/next/src/lib/fatal-error.ts
+0
-1
getTypeScriptConfiguration.ts
...ges/next/src/lib/typescript/getTypeScriptConfiguration.ts
+4
-6
missingDependencyError.ts
packages/next/src/lib/typescript/missingDependencyError.ts
+1
-2
verify-partytown-setup.ts
packages/next/src/lib/verify-partytown-setup.ts
+19
-30
next-server-nft.test.ts
test/production/next-server-nft/next-server-nft.test.ts
+0
-1
No files found.
crates/next-error-code-swc-plugin/src/lib.rs
View file @
62f0d467
...
...
@@ -56,7 +56,6 @@ fn is_error_class_name(name: &str) -> bool {
||
name
==
"DecodeError"
||
name
==
"DynamicServerError"
||
name
==
"ExportError"
||
name
==
"FatalError"
||
name
==
"ImageError"
||
name
==
"InstantValidationError"
||
name
==
"InvariantError"
...
...
packages/next/src/lib/fatal-error.ts
deleted
100644 → 0
View file @
acb41ed6
export
class
FatalError
extends
Error
{}
packages/next/src/lib/typescript/getTypeScriptConfiguration.ts
View file @
62f0d467
...
...
@@ -3,7 +3,6 @@ import os from 'os'
import
path
from
'path'
import
semver
from
'next/dist/compiled/semver'
import
{
FatalError
}
from
'../fatal-error'
import
isError
from
'../is-error'
function
resolvePathAliasTarget
(
baseUrl
:
string
,
target
:
string
):
string
{
...
...
@@ -92,9 +91,7 @@ export async function getTypeScriptConfiguration(
typescript
.
sys
.
readFile
)
if
(
error
)
{
throw
new
FatalError
(
typescript
.
formatDiagnostic
(
error
,
formatDiagnosticsHost
)
)
throw
new
Error
(
typescript
.
formatDiagnostic
(
error
,
formatDiagnosticsHost
))
}
let
configToParse
:
any
=
config
...
...
@@ -185,7 +182,8 @@ export async function getTypeScriptConfiguration(
}
if
(
result
.
errors
?.
length
)
{
throw
new
FatalError
(
// TODO: Throw AggregateError for all diagnostics.
throw
new
Error
(
typescript
.
formatDiagnostic
(
result
.
errors
[
0
],
formatDiagnosticsHost
)
)
}
...
...
@@ -194,7 +192,7 @@ export async function getTypeScriptConfiguration(
}
catch
(
err
)
{
if
(
isError
(
err
)
&&
err
.
name
===
'SyntaxError'
)
{
const
reason
=
'
\
n'
+
(
err
.
message
??
''
)
throw
new
Fatal
Error
(
throw
new
Error
(
bold
(
'Could not parse'
+
cyan
(
'tsconfig.json'
)
+
...
...
packages/next/src/lib/typescript/missingDependencyError.ts
View file @
62f0d467
...
...
@@ -2,7 +2,6 @@ import { bold, cyan, red } from '../picocolors'
import
{
getOxfordCommaList
}
from
'../oxford-comma-list'
import
type
{
MissingDependency
}
from
'../has-necessary-dependencies'
import
{
FatalError
}
from
'../fatal-error'
import
{
getPkgManager
}
from
'../helpers/get-pkg-manager'
export
function
missingDepsError
(
...
...
@@ -21,7 +20,7 @@ export function missingDepsError(
' file from your package root (and any TypeScript files in your app and pages directories).'
)
throw
new
Fatal
Error
(
throw
new
Error
(
bold
(
red
(
`It looks like you're trying to use TypeScript but do not have the required package(s) installed.`
...
...
packages/next/src/lib/verify-partytown-setup.ts
View file @
62f0d467
...
...
@@ -5,14 +5,13 @@ import path from 'path'
import
{
hasNecessaryDependencies
}
from
'./has-necessary-dependencies'
import
type
{
NecessaryDependencies
}
from
'./has-necessary-dependencies'
import
{
fileExists
,
FileType
}
from
'./file-exists'
import
{
FatalError
}
from
'./fatal-error'
import
*
as
Log
from
'../build/output/log'
import
{
getPkgManager
}
from
'./helpers/get-pkg-manager'
async
function
missingDependencyError
(
dir
:
string
)
{
const
packageManager
=
getPkgManager
(
dir
)
throw
new
Fatal
Error
(
throw
new
Error
(
bold
(
red
(
"It looks like you're trying to use Partytown with next/script but do not have the required package(s) installed."
...
...
@@ -65,35 +64,25 @@ export async function verifyPartytownSetup(
dir
:
string
,
targetDir
:
string
):
Promise
<
void
>
{
try
{
const
partytownDeps
:
NecessaryDependencies
=
hasNecessaryDependencies
(
dir
,
[
{
file
:
'@builder.io/partytown'
,
pkg
:
'@builder.io/partytown'
,
exportsRestrict
:
false
,
},
])
const
partytownDeps
:
NecessaryDependencies
=
hasNecessaryDependencies
(
dir
,
[
{
file
:
'@builder.io/partytown'
,
pkg
:
'@builder.io/partytown'
,
exportsRestrict
:
false
,
},
])
if
(
partytownDeps
.
missing
?.
length
>
0
)
{
await
missingDependencyError
(
dir
)
}
else
{
try
{
await
copyPartytownStaticFiles
(
partytownDeps
,
targetDir
)
}
catch
(
err
)
{
Log
.
warn
(
`Partytown library files could not be copied to the static directory. Please ensure that
${
bold
(
cyan
(
'@builder.io/partytown'
)
)}
is installed as a dependency.`
)
}
}
}
catch
(
err
)
{
// Don't show a stack trace when there is an error due to missing dependencies
if
(
err
instanceof
FatalError
)
{
console
.
error
(
err
.
message
)
// Throw to allow finally blocks to run (e.g., telemetry flush)
throw
err
if
(
partytownDeps
.
missing
?.
length
>
0
)
{
await
missingDependencyError
(
dir
)
}
else
{
try
{
await
copyPartytownStaticFiles
(
partytownDeps
,
targetDir
)
}
catch
(
err
)
{
Log
.
warn
(
`Partytown library files could not be copied to the static directory. Please ensure that
${
bold
(
cyan
(
'@builder.io/partytown'
)
)}
is installed as a dependency.`
)
}
throw
err
}
}
test/production/next-server-nft/next-server-nft.test.ts
View file @
62f0d467
...
...
@@ -243,7 +243,6 @@ async function readNormalizedNFT(next, name) {
"/node_modules/next/dist/lib/download-swc.js",
"/node_modules/next/dist/lib/error-telemetry-utils.js",
"/node_modules/next/dist/lib/fallback.js",
"/node_modules/next/dist/lib/fatal-error.js",
"/node_modules/next/dist/lib/file-exists.js",
"/node_modules/next/dist/lib/find-config.js",
"/node_modules/next/dist/lib/find-pages-dir.js",
...
...
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