No description
Find a file
Justin Ridgewell 81542ff759 Fix routing cases (vercel/turbo#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: … }`
2023-02-16 08:55:14 +00:00
packages/next-swc/crates Fix routing cases (vercel/turbo#3832) 2023-02-16 08:55:14 +00:00