Skip to content

Commit 06449f4

Browse files
committed
Fix missing module.compiled trace file
1 parent 4c6d4b3 commit 06449f4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/next/src/build/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,12 +2269,13 @@ export default async function build(
22692269
const moduleTypes = ['app-page', 'pages']
22702270

22712271
for (const type of moduleTypes) {
2272+
const modulePath = require.resolve(
2273+
`next/dist/server/future/route-modules/${type}/module.compiled`
2274+
)
2275+
const relativeModulePath = path.relative(root, modulePath)
2276+
22722277
const contextDir = path.join(
2273-
path.dirname(
2274-
require.resolve(
2275-
`next/dist/server/future/route-modules/${type}/module`
2276-
)
2277-
),
2278+
path.dirname(modulePath),
22782279
'vendored',
22792280
'contexts'
22802281
)
@@ -2287,6 +2288,8 @@ export default async function build(
22872288
addToTracedFiles(root, itemPath, tracedFiles)
22882289
addToTracedFiles(root, itemPath, minimalTracedFiles)
22892290
}
2291+
addToTracedFiles(root, relativeModulePath, tracedFiles)
2292+
addToTracedFiles(root, relativeModulePath, minimalTracedFiles)
22902293
}
22912294

22922295
await Promise.all([

0 commit comments

Comments
 (0)