Next.js Middleware on Edge function is not called

Hey there,

I got 2 netlify app, on the same domain (lets call it example.com):

  • first one let’s call it MainWebSite, which is static generated website with gatsby, on its own domain.
  • second one let’s call it SecondWebSite, which is a next.js website with SSR, app router and middleware

MainWebSite redirects some urls on SecondWebSite with _redirect file like:
/fr/blabla https://my-app.netlify.app/fr/blabla 200

when I go to https://my-app.netlify.app/fr/blabla, the ssr function works, and the middleware works fine on the edge function, i got logs and no issue on the website.

When i go to https://example.com/fr/blabla, the redirect works, the ssr function of SecondWebSite works, but the middleware and edge function are never called.

Do you know who I can fix this ?

Thanks, Alex

Can you attach attach a link of your function log?

There is no log at all when going to https://example.com/fr/whatever

But in case of : the second site is frabjous-mochi-6481eb, the edge function is just never called

I tried to set NEXT_DISABLE_NETLIFY_EDGE to true. But the middleware isn’t called on the ssr function either in that case. The website does not work on both URL with this env variable

Hi @software,

As mentioned in the helpdesk, this has been escalated to the devs.