Hello, I have built a lamba function. It works locally. It has to import a json. When I deploy it with the same code to bitbucket, and build the site, when I call the function and go to the functions tab on netlify. it says file not found.
Error: ENOENT: no such file or directory, open ‘/var/task/lambda/connection.json’
I’m pretty positive the path is correct. How do I access a JSON from a lambda function? It doesn’t seem that the JSON actually gets included in the build and deploy, so it sits in bitbucket but never gets built. How do I include this? I dont need a database for something so simple right?
someone please help me, I’ve been stuck on this for days, almost a week. I just want to use a JSON in my lambda function. Do I need to now set up a data base and call that? Or can I just store it in a file next to my lambda function?
@luke Thanks! ive read through it all, but what are the actual commands I would use to zip this? Some places I see using netlify deploy, but does then I read you need to zip it and ship it before. What are the actual real steps for this? I dont really see anything on that
@luke ok this is driving me crazy. I came across a blog of a guy basically saying the same thing as me
What is going on? Why is it so difficult for me just to require files in my lambda functions? Is this how netlify lambda functions will be? I have been at this for days and if I didn’t use this Lambda function approach, I could have been finished days ago. Am I doing something wrong??
I got my first JSON to load, but now I am trying to get an id file to load next to it, ugh, the file is literally sitting next to it I have functions for this, but NOOOOOOO, lambda functions dont allow you to import files without a bunch of mumbo jumbo. How do you use zip-it-and-ship it I havent found a single doc where it shows how to actually implement it???
Hi there. @marcus I am trying your example GitHub - mraerino/netlify-functions-readfile but i just got this error “error decoding lambda response: error decoding lambda response: json: cannot unmarshal object into Go struct field .body of type string” when running the function.
Thanks for your help.