-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serverless function demo not working locally as described #11
Comments
Thanks for reporting this issue @skberko ! Based on the local server logs you shared, I suspect you may be encountering a known Netlify CLI bug that manifests with only certain node.js versions. Could you please run Related CLI issues:
|
Thanks for the reply, @klavavej. I was originally on
Not sure this is related to #3617, as the server started fine on both versions for me. Some of those other issues look relevant, though. Anyhow, hope this helps! 🙂 |
Any updates on the Node 17 / 18 versions, related to the digital envelope routines::unsupported bug? |
TL;DR
Serverless functions may not run in
netlify dev
mode without additional setup not currently specified in the feature tour docs.Details
👋 Howdy, Netlify friends!
I just went through this repo in preparation for a chat with the Netlify dev team tomorrow and got a bit stuck with the
Create Your First Serverless Function
section of the demo. Specifically, I was able to deploy and get a serverless function running in production but not locally (i.e. usingnetlify dev
on my machine).Unless I'm missing something (definitely possible, given my rusty JS chops!), it seems like these instructions on the
Netlify Functions
page may need a bit of tweaking:When I create the function and run
netlify dev
on my machine as instructed, then clickTest Your Function
, I get the following error:In the local server logs, I'm seeing:
curl
-ing the function endpoint directly doesn't seem to be working either:I played around with different filenames and paths for a bit before deciding to deploy to production to see if I could break my site there. However, to my surprise, the exact same code worked in prod:
Unlike in dev, in production,
curl
-ing the function endpoint works as expected:In case it helps, here's a screenshot of the function I wrote (simple copy-pasta from the instructions) as well as its location within my project:
I'm guessing that there must be some additional setup needed to spark the
/.netlify
path magic and get functions running locally. It could be great if you could update the repo to include instructions on how to do that - or at least remove the suggestion to try running functions locally so anxious candidates like me don't tear more hair out than necessary 😅The text was updated successfully, but these errors were encountered: