Node.js Alexa Task Issue
I\'m currently coding a Node.js Alexa Task via AWS Lambda, and I have been trying to code a function that receives informat
In my case it was because I had the handler file in inner src directory.
I had to change the 'Handler' property within Lambda from:
index.handler
to
src/index.handler
In my case this was caused by Node running out of memory. I fixed that by adding --memory-size 1500
to my aws lambda create-function ...
command.
I got this error when I was using lambci/lambda:nodejs8.10
in windows.
I'd tried all of the solution listed above but none of which could help me deal with my issue(even though the error stack look the same as the question).
Here is my simple solution:
--entrypoint
flag to run a container to find out if the file is mounted into the container. It turns out I may got the share drive issue with my Docker Desktop. docker
command or just open the Docker Desktop setting to apply. Check that file name and handler name are same:
That means that zip
file has bundle.js
file that exports handler
function:
exports.handler = (event, context, callback) => {//...}
In my case the archive contained a folder "src" with index.js file, so I had to put to the handler: "src/index.handler"
Fixed it! My issue was that I tried to zip the file using my Mac's built-in compression function in Finder.
If you're a Mac user, like me, you should run the following script in terminal when you are in the root directory of your project (folder containing your index.js
, node_modules
, etc. files).
zip -r ../yourfilename.zip *
For Windows:
Compress-Archive -LiteralPath node_modules, index.js -DestinationPath yourfilename.zip