For the life of me, I cannot get more than one function to work …
In my functions folder, I have 4 JS files. Only one of them seems to work, the rest all return 502 bad gateway. Even when I remove all dependencies and logic, they all still fail to run, other than the first one I ever uploaded.
I’m relying on the deploy process to find and use the node_modules from the parent folder. Since that works for one, why not for the others? From the output in the build, it sure looks like that’s what’s happening, but I can’t seem to get any logging to see what’s happening. Can someone help troubleshoot?
Here’s one of them, as an example.
'use strict';
exports.handler = async (event,context) => {
const response = {
statusCode: 200,
body: JSON.stringify(['hello','world']),
};
return response;
};
Here’s the output for it:
http post React App
HTTP/1.1 502 Bad Gateway
Age: 0
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 0
Date: Thu, 09 Apr 2020 21:16:08 GMT
Server: Netlify
X-NF-Request-ID: d5081376-b74c-47ff-9314-8379ba2a93ca-6435107
It should be noted that this function DOES RUN at AWS Lambda, so I reasonably sure it’s coded properly.