Skip to content

Commit

Permalink
Always tell the client the server is stopped on error
Browse files Browse the repository at this point in the history
  • Loading branch information
benjreinhart committed Oct 23, 2024
1 parent cc1db6e commit d7dd357
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/api/server/channels/app.mts
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ async function previewStart(
// Make sure we clean up the app process and inform the client.
deleteAppProcess(app.externalId, 'vite:server');

if (error.code === 'ENOENT') {
wss.broadcast(`app:${app.externalId}`, 'preview:status', {
url: null,
status: 'stopped',
code: null,
});
}
// TODO: Use a different event to communicate to the client there was an error.
// If the error is ENOENT, for example, it means node_modules and/or vite is missing.
wss.broadcast(`app:${app.externalId}`, 'preview:status', {
url: null,
status: 'stopped',
code: null,
});
},
});
}
Expand Down

0 comments on commit d7dd357

Please sign in to comment.