There was an error while loading. Please reload this page.
1 parent 15f725b commit f0d6802Copy full SHA for f0d6802
1 file changed
packages/nuxt-cli/src/commands/build.ts
@@ -70,11 +70,15 @@ export default defineCommand({
70
// reported below it rather than above.
71
if (ctx.args.logLevel !== 'silent') {
72
const reporter = createPhaseReporter({ heartbeat: HEARTBEAT_INTERVAL })
73
- const unsubscribe = progress.onUpdate(reporter.update)
+ let unsubscribe: (() => void) | undefined
74
+ // Assigned before subscribing, because subscribing reports the phase in
75
+ // flight straight away: a first write that fails, on a pipe that has
76
+ // already been closed, must still leave the terminal recoverable.
77
stopReporting = () => {
- unsubscribe()
78
+ unsubscribe?.()
79
reporter.stop()
80
}
81
+ unsubscribe = progress.onUpdate(reporter.update)
82
83
84
const kit = await loadKit(cwd)
0 commit comments