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
87fc1b9d
Unverified
Commit
87fc1b9d
authored
Oct 27, 2025
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Oct 27, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix duplicate .next/types `include` on Windows (#85400)
parent
8cdd4ead
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
writeConfigurationDefaults.ts
...ges/next/src/lib/typescript/writeConfigurationDefaults.ts
+8
-3
No files found.
packages/next/src/lib/typescript/writeConfigurationDefaults.ts
View file @
87fc1b9d
import
{
readFileSync
,
writeFileSync
}
from
'fs'
import
*
as
path
from
'path'
import
{
bold
,
cyan
,
white
}
from
'../picocolors'
import
*
as
CommentJson
from
'next/dist/compiled/comment-json'
import
semver
from
'next/dist/compiled/semver'
...
...
@@ -267,7 +268,11 @@ export async function writeConfigurationDefaults(
}
}
const
nextAppTypes
:
string
[]
=
[
`
${
distDir
}
/types/**/*.ts`
]
const
distDirPosix
=
path
.
win32
.
sep
===
path
.
sep
?
distDir
.
replaceAll
(
path
.
win32
.
sep
,
path
.
posix
.
sep
)
:
distDir
const
nextAppTypes
:
string
[]
=
[
`
${
distDirPosix
}
/types/**/*.ts`
]
// When isolatedDevBuild is enabled, Next.js uses different distDir paths:
// - Development: "{distDir}/dev"
...
...
@@ -279,10 +284,10 @@ export async function writeConfigurationDefaults(
process
.
env
.
NODE_ENV
===
'development'
?
// In dev, distDir is "{distDir}/dev", which is already in the array above, but we also need "{distDir}/types".
// Here we remove "/dev" at the end of distDir for consistency.
`
${
distDir
.
replace
(
/
\/
dev$/
,
''
)}
/types/**/*.ts`
`
${
distDir
Posix
.
replace
(
/
\/
dev$/
,
''
)}
/types/**/*.ts`
:
// In build, distDir is "{distDir}", which is already in the array above, but we also need "{distDir}/dev/types".
// Here we add "/dev" at the end of distDir for consistency.
`
${
distDir
}
/dev/types/**/*.ts`
`
${
distDir
Posix
}
/dev/types/**/*.ts`
)
// Sort the array to ensure consistent order.
nextAppTypes
.
sort
((
a
,
b
)
=>
a
.
length
-
b
.
length
)
...
...
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