Open herkulano opened 7 months ago
TIL Typescript treats
const fn1 = () : never => {}
// and
function fn2(): never {}
differently :)
Update: It seems like this is unfixable at the moment because it is blocked by microsoft/TypeScript#56049. I'll look if we can adjust the API in order to sidestep this
Problem
Internally nextjs throws an error on
redirect()
so Typescript infers that there's no return afterredirect()
.Using
paraglide-js-adapter-next
redirect()
this is no longer the case.If the server action/route/rsc ends with a redirect Typescript should understand that redirect throws an error and ignore the code below it:
Expected behavior
No response
Reproduction
Use
paraglide-js-adapter-next
redirect()
in a route/server action/rscOther information
No response