Skip to content

Commit 530c4a2

Browse files
authored
Turbopack: don't hardcode edge-instrumentation.js (#75289)
1 parent 2aa59ed commit 530c4a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/next/src/build/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2457,7 +2457,11 @@ export default async function build(
24572457
path.join(SERVER_DIRECTORY, `${INSTRUMENTATION_HOOK_FILENAME}.js`)
24582458
)
24592459
// If there's edge routes, append the edge instrumentation hook
2460-
if (edgeRuntimeAppCount || edgeRuntimePagesCount) {
2460+
// Turbopack generates this chunk with a hashed name and references it in middleware-manifest.
2461+
if (
2462+
!process.env.TURBOPACK &&
2463+
(edgeRuntimeAppCount || edgeRuntimePagesCount)
2464+
) {
24612465
instrumentationHookEntryFiles.push(
24622466
path.join(
24632467
SERVER_DIRECTORY,

0 commit comments

Comments
 (0)