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
34dd8d42
Unverified
Commit
34dd8d42
authored
Oct 29, 2025
by
Jiachi Liu
Committed by
GitHub
Oct 29, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[turbopack] fix build of empty entries of pages (#84873)
parent
62bc243b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
entries.ts
packages/next/src/build/entries.ts
+6
-0
index.ts
packages/next/src/build/index.ts
+5
-0
.gitkeep
test/production/500-page/app-router-only/pages/.gitkeep
+0
-0
No files found.
packages/next/src/build/entries.ts
View file @
34dd8d42
...
@@ -552,6 +552,12 @@ export async function createPagesMapping({
...
@@ -552,6 +552,12 @@ export async function createPagesMapping({
// added or removed.
// added or removed.
const
root
=
isDev
&&
pagesDir
?
PAGES_DIR_ALIAS
:
'next/dist/pages'
const
root
=
isDev
&&
pagesDir
?
PAGES_DIR_ALIAS
:
'next/dist/pages'
// If there are no user pages routes, treat this as app-dir-only mode.
// The pages/ folder could be present and the initial appDirOnly is treated as false, but no valid routes are found.
if
(
Object
.
keys
(
pages
).
length
===
0
&&
!
appDirOnly
)
{
appDirOnly
=
true
}
return
{
return
{
// Don't add default pages entries if this is an app-router-only build
// Don't add default pages entries if this is an app-router-only build
...((
isDev
||
!
appDirOnly
)
&&
{
...((
isDev
||
!
appDirOnly
)
&&
{
...
...
packages/next/src/build/index.ts
View file @
34dd8d42
...
@@ -1276,6 +1276,11 @@ export default async function build(
...
@@ -1276,6 +1276,11 @@ export default async function build(
)
)
NextBuildContext
.
mappedPages
=
mappedPages
NextBuildContext
.
mappedPages
=
mappedPages
// Update appDirOnly if no user pages routes are found
if
(
Object
.
keys
(
mappedPages
).
length
===
0
&&
!
appDirOnly
)
{
NextBuildContext
.
appDirOnly
=
appDirOnly
=
true
}
let
mappedAppPages
:
MappedPages
|
undefined
let
mappedAppPages
:
MappedPages
|
undefined
let
mappedAppLayouts
:
MappedPages
|
undefined
let
mappedAppLayouts
:
MappedPages
|
undefined
let
denormalizedAppPages
:
string
[]
|
undefined
let
denormalizedAppPages
:
string
[]
|
undefined
...
...
test/production/500-page/app-router-only/pages/.gitkeep
0 → 100644
View file @
34dd8d42
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