#Hi
1 messages · Page 1 of 1 (latest)
The error suggests Next.js can't find your proxy.js file. Based on the documentation, the file must be placed in one of these locations:
- Project root (same level as
package.json) - Inside
src/(same level as yourpagesorappdirectory)
Since you're using src/middleware.js, you need to rename and move it to src/proxy.js. [proxy.js file conventions]
You can also run the official codemod to handle the rename automatically:
npx @next/codemod@canary middleware-to-proxy .
Note: There are known issues reported by users where
proxy.ts/jsdoesn't work in build mode when the file is insidesrc/, whilemiddleware.tsworks fine in both dev and build. If you continue experiencing issues after renaming, you may want to temporarily revert tomiddleware.tsuntil these bugs are resolved. [GitHub issue]