We created a trivial hello world function with path /myapi/hello/:name
. It works as expected locally (netlify dev
). When the site is ran remotely in a Deploy Preview, the function returns 404 from the underlying static site. In other words, the function is not executing at the URL.
Are Netlify functions expected to work in deploy previews?
Additional detail:
The function appears to be detected by the remote build, but the build log has contradictory information: In the summary, it says “1 function deploy” In the details, it stas “0 new functions to upload”.
When visiting the function log, the function endpoint appears with the production website URL, not the deploy preview URL, which is confusing since the function has only been deployed to a deploy preview via PR.