Skip to content

Commit 018472d

Browse files
gaojudeMoroshima
authored andcommitted
Fix telemetry event race condition in webpack worker for @vercel/og detection (vercel#86145)
1 parent ceaf6d8 commit 018472d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/next/src/build/webpack-build/impl.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,5 +414,7 @@ export async function workerMain(workerData: {
414414
result.buildTraceContext!.chunksTrace!.entryNameFilesMap = entryNameFilesMap
415415
}
416416
NextBuildContext.nextBuildSpan.stop()
417+
await telemetry.flush()
418+
417419
return { ...result, debugTraceEvents: getTraceEvents() }
418420
}

test/integration/telemetry/test/config.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ describe('config telemetry', () => {
441441
;(process.env.IS_TURBOPACK_TEST ? it.skip : it)(
442442
'emits telemetry for usage of @vercel/og',
443443
async () => {
444+
// Test vercelImageGeneration telemetry tracking
444445
const { stderr } = await nextBuild(appDir, [], {
445446
stderr: true,
446447
env: { NEXT_TELEMETRY_DEBUG: '1' },

0 commit comments

Comments
 (0)