I’m trying to run an edge function on certain paths of a Gatsby site (shelter-website
- england.shelter.org.uk). I have defined the function like this in netlify.toml
:
[[edge_functions]]
path = "/get_help"
function = "test-webchat"
When running netlify dev
or netlify serve
locally the function works as expected, but only when navigating directly to /get_help
. It is not called when following a link to get_help
from the site’s nav (or any other link to it).
My assumption is that a route change in reach-router isn’t recognised as a page load. Is this correct?
Is this a limitation of edge functions or is there a way to work around this so that the edge function is called each time this route is loaded?
Thanks