Netlify Edge function clashing with nextjs dynamic route

Hi,

I’m trying to use Netlify Edge Functions for my website.
I’m also using NextJS.

The problem I’m facing is that I have a Dynamic Route like this:

https://mywebsite/[slug]

and my netlify’s toml file has something like this:

[[edge_functions]]
  path = "/myfunction"
  function = "myfunction"

the problem is, since I’m using a dynamic route for my website, there’s no way for me to access the netlify function on it’s path because it tries to run the dynamic function instead.

So, if I visit: https://mywebsite/myfunction
my website tries to run:
/pages/[slug]/index.tsx

instead of
/netlify/edge-functions/myfunction.ts

Does anyone have any idea on how to exclude my edge function from being served by nextjs’ dynamic routes?

Thanks

Hey @raulvidzing,

I’ve responded to your question in the helpdesk. Let us know where you’d like to continue the discussion.