Skip to content

Commit 77ececa

Browse files
sokraclaude
authored andcommitted
fix: move getCacheDir before Telemetry init to preserve CI cache warning
The Telemetry constructor creates distDir/cache in CI environments via getStorageDirectory(). Moving telemetry init before installBindings (previous commit) inadvertently caused getCacheDir's "no-cache" warning to be suppressed because the cache dir already existed when checked. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 748be3b commit 77ececa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/next/src/build/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,10 @@ export default async function build(
10201020
setGlobal('phase', PHASE_PRODUCTION_BUILD)
10211021
setGlobal('distDir', distDir)
10221022

1023+
// Check for build cache before initializing telemetry, because the
1024+
// Telemetry constructor creates the cache directory in CI environments.
1025+
const cacheDir = getCacheDir(distDir)
1026+
10231027
// Initialize telemetry before installBindings so that SWC load failure
10241028
// events are captured if native bindings fail to load.
10251029
const telemetry = new Telemetry({ distDir })
@@ -1123,8 +1127,6 @@ export default async function build(
11231127
)
11241128
}
11251129

1126-
const cacheDir = getCacheDir(distDir)
1127-
11281130
const publicDir = path.join(dir, 'public')
11291131
const { pagesDir, appDir } = findPagesDir(dir)
11301132

0 commit comments

Comments
 (0)