Issues accessing the /.well-known/farcaster.json route of my Next.js app

I have deployed my obtain-tribals.netlify.app Next.js app, but I have trouble accessing the /.well-known/farcaster.json route.

The route is served by a Response.json() method in thefarcaster.jsonfolder in thewell-knowndirectory. I can access that route just fine locally, and through testing with thenetlify devcommand.

But whenever I try to access the route on the deployed app on Netlify, I get this error:

[Error: Cannot find module ‘/var/task/.next/server/app/.well-known/farcaster.json/route.js’
Require stack:

  • /var/task/node_modules/next/dist/server/require.js
  • /var/task/node_modules/next/dist/server/next-server.js
  • /var/task/node_modules/next/dist/server/next.js
  • /var/task/node_modules/next/dist/server/lib/start-server.js
  • /var/task/.netlify/dist/run/next.cjs] {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [Array]
    }

This clearly seems like either a router issue at the level of Netlify, as I can confirm that the route works on other platforms, and on my local machine with both the yarn and netlify command.

I’ve submitted a PR with a fix: fix: allow dot files in function bundle by hrishikesh-k · Pull Request #3118 · opennextjs/opennextjs-netlify. Once it’s merged and a new version of @netlify/plugin-nextjs is rolled out which includes that change, this should be resolved.