Skip to content

Commit

Permalink
Catch and do nothing to avoid triggering unhandled exception problems
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Dec 9, 2022
1 parent b5cbd96 commit 535bd8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/lib/core-server/src/dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export async function storybookDevServer(options: Options) {
// this is a preview route, the builder has to be started before we can serve it
// this handler keeps request to that route pending until the builder is ready to serve it, preventing a 404
router.get('/iframe.html', (req, res, next) => {
previewStarted.then(() => next());
// We need to catch here or node will treat any errors thrown by `previewStarted` as
// unhandled and exit (even though they are very much handled below)
previewStarted.catch(() => {}).then(() => next());
});

Promise.all([initializedStoryIndexGenerator, listening, usingStatics]).then(async () => {
Expand Down

0 comments on commit 535bd8d

Please sign in to comment.