Skip to content

Commit d4be053

Browse files
committed
fix: Ensure typegen CLI command doesn't hang due to open handles
1 parent 92f23da commit d4be053

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/next/src/bin/next.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,10 @@ program
395395
)}`
396396
)
397397
.action((directory: string, options: NextTypegenOptions) =>
398+
// ensure process exits after build completes so open handles/connections
399+
// don't cause process to hang
398400
import('../cli/next-typegen.js').then((mod) =>
399-
mod.nextTypegen(options, directory)
401+
mod.nextTypegen(options, directory).then(() => process.exit(0))
400402
)
401403
)
402404
.usage('[directory] [options]')

0 commit comments

Comments
 (0)