#Hi

1 messages · Page 1 of 1 (latest)

tacit gateBOT
#

Hi @kind nimbus. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

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 your pages or app directory)

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 .

[Migration to Proxy]

Note: There are known issues reported by users where proxy.ts/js doesn't work in build mode when the file is inside src/, while middleware.ts works fine in both dev and build. If you continue experiencing issues after renaming, you may want to temporarily revert to middleware.ts until these bugs are resolved. [GitHub issue]

Also note that the edge runtime is not supported in proxy — it runs on Node.js only. This is relevant since you're using @supabase/ssr which requires Node.js APIs, so this should be fine for your use case. [middleware to proxy]

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: