diff --git a/src/dev/server.ts b/src/dev/server.ts index 3c8be76b7d..64dffe5dd8 100644 --- a/src/dev/server.ts +++ b/src/dev/server.ts @@ -172,7 +172,7 @@ export function createDevServer(nitro: Nitro): NitroDevServer { app.use( eventHandler(async (event) => { await reloadPromise; - const address = currentWorker?.address; + const address = currentWorker && currentWorker.address; if (!address || (address.socketPath && !existsSync(address.socketPath))) { return errorHandler(lastError, event); }