Commit 5c184f4
authored
fix(nextjs): Avoid wrapping middleware files when in standalone mode (#18172)
This PR attempts to fix #18001 by not wrapping the middleware files if
Next.js 16 is the current version and is in standalone output mode which
is the problematic scenario.
Investigation:
- Next.js renames `proxy` to `middleware` under the hood.
- By wrapping the middleware a `proxy.js` entry is produced in
`middleware.js.nft.json` which wouldn't be there otherwise, meaning if
we don't wrap it then that entry doesn't get produced. So it seems like
`@vercel/nft` is somehow adding the `proxy` file as a dependency of
itself which fails to copy to the output directory because it was
already copied and renamed to `proxy.js` or at least that is what I'm
guessing is happening.1 parent 679a02c commit 5c184f4
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
| |||
0 commit comments