-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix routing cases (vercel/turborepo#3832)
This fixes 2 bugs that I've found: 1. If the `middleware.ts` file doesn't exist, then we get an unhelpful `unable to resolve relative "."` error during `next-edge` transition processing - This is fixed by not processing the `VirtualAssetVc` with the edge transition 2. If you're using an older Next version, then the router doesn't have a `type` field - Because the `type` field is empty, we hit neither the `rewrite` nor `none` cases and fall through to the middleware case, returning an empty response with no body. - This is fixed by treating `{ url: string, headers: … }` as `{ type: 'rewrite', url: string, headers: … }`
- Loading branch information
1 parent
c4b4a70
commit c7ceb16
Showing
3 changed files
with
50 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters