If you create a cache function that throws a redirect it will exit the server saying that the promise was unhandled:
[UnhandledPromiseRejection: This error originated either by throwing inside of an async
function without a catch block, or by
rejecting a promise which was not handled with .catch(). The promise rejected
with the reason "#<_Response>".] {
code: 'ERR_UNHANDLED_REJECTION'
}
I encountered this issue specifically under the context of start but I found that downgrading the @solidjs/router version to 0.12.0 fixed this. This seems to only happen when deferStream is not set to true as well.
Describe the bug
If you create a cache function that throws a
redirect
it will exit the server saying that the promise was unhandled:I encountered this issue specifically under the context of start but I found that downgrading the
@solidjs/router
version to0.12.0
fixed this. This seems to only happen whendeferStream
is not set to true as well.Your Example Website or App
https://github.com/solidjs/solid-start/tree/main/examples/with-auth
Steps to Reproduce the Bug or Issue
This can be very well reproduced using the
with-auth
Solid Start example.deferStream
fromcreateAsync
inside ofsrc/routes/index.tsx
pnpm dev
Both when
deferStream
is enabled on@solidjs/router@0.12.3
and whendeferStream
is disabled on@solidjs/router@0.12.0
this does work.Expected behavior
That the redirect is caught on the server and responds with the appropriate Response such that the user is redirected without errors on the server.
Screenshots or Videos
No response
Platform
Additional context
No response