TanStackT
TanStack4w ago
1 reply
developed-pink

Workaround for Node server crashing in dev mode resulting from unhandled rejections in loaders?

This is about this issue from 2 months ago: https://github.com/TanStack/router/issues/5589 (includes complete reproducer project)

This is incredibly annoying. Ideally in loaders we should be able to freely prefetch any queries needed and rely on our error boundaries or handlers to deal with them. This is a really common thing to do. Yet the loaders crash the node process in development.

Are there any workarounds for this (I'd hate to wrap all my loaders with catches)? Or better yet: does anyone have a clue where in the Start/Router code this can be addressed? (At this point I'd much rather sift through the code and fix this bug myself than work on a subpar workaround)
GitHub
Which project does this relate to? Start Describe the bug A rejected but unhandled promise in a route loader function crashes Node.js when run in dev mode with ELIFECYCLE Command failed with exit c...
Start: Unhandled rejected promise in loader function crashes Node p...
Was this page helpful?