a63b89b140
### What #51394 introduced a pretty strict type of return value of route type that causing failure with `next build`. There're few ways of writing a app route, it could contain few return values based on the usage: * return a `Response` or promise of it * return `NextResponse` of promise of it, since it's extended from `Response`, same type * use `redirect()` or `notFound(), since it returns `never`, and the below code is not reached, the handler itself could still return void. e.g. using `redirect` in a `GET` route We loosed the type so `redirect()` can be still allowed without specifying the return value there. Related typescript issue: https://github.com/microsoft/TypeScript/issues/16608#issuecomment-309327984 ### How * Re-enable the bail on types / build error in the app-routes tests * Separate the tests, move runtime erroring ones to `test/e2e/app-dir/app-routes-errors` * Add new case to app-routes tests of mixed return value Closes #55623 Related #55604 |
||
---|---|---|
.. | ||
app/lowercase | ||
hello.js | ||
index.test.ts |