Skip to content

Commit

Permalink
fix(dev): dev server should handle compilation errors in its own code
Browse files Browse the repository at this point in the history
If the dev server is modified while running and the new version has a
syntax error, we want to wait for the next file change rather than exit
the dev server entirely.
  • Loading branch information
justmoon committed Oct 4, 2024
1 parent 6a08459 commit 7753d98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/app-dev/bin/start-development-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function restart() {
isRestartQueued = true

log(chalk.green("\n Restarting development server...\n"))
void (async () => {
;(async () => {
try {
await startupPromise
await reactor.dispose()
Expand All @@ -165,5 +165,7 @@ function restart() {
viteNodeServer.fetchCache = new Map()

reactor = await start()
})()
})().catch((/** @type unknown */ error) => {
console.error(error)
})
}

0 comments on commit 7753d98

Please sign in to comment.