My answer is not going to address your question as much as clear up what I think you might be doing that would get you in some trouble down the road.
A “PRIVATE” API key shouldn’t be exposed to your front end. The implementation you are referring to is using the key in a function in a lambda server.
The call you are doing here would expose the key to the client and anyone would be able to access this data using your key!
The api call to
https://api.themoviedb.org/3/discover/movie should be done inside the lambda function and return the data to
fetchMovies. This way your API key would not be exposed to the client.
Answer to your question. You are not actually calling the lambda function on this call. You are fetching directly to a file that doesn’t exist and getting the page response as if you went to this url:
https://davidronnlidmovies.netlify.app/netlify/functions/api.js which is a webpage from your SPA.
The endpoint for the lambda has a path like:
https://davidronnlidmovies.netlify.app/.netlify/functions/api which is currently erroring. Good news, because you definitely do not want to pass your private api key inside this function to the web.
I hope all this made sense.