Open philiprenich opened 3 years ago
Following the route from the stack overflow answer and using path.join
worked. However, this was a direct change to the compiled asset once the build was done, so is not a viable solution. Hopefully a code change here could solve it.
I'm curious why it has an issue in AWS Lambda functions and what specifically causes it because it's a showstopper that would be very noticeable if it was widespread. I'm not familiar enough with AWS's environment to know what is different about our set up.
I'm having the same issue @philiprenich, I was wondering if you found a solution?
The problem is indeed with the webpack output not including the cacert.pem bundle. The path.join / stackoverflow solution did not make a difference for me but it might work with a file loader of some sort. Sadly my webpack knowlege is not good enough to come up with a suggestion here.
I got it working by coping the node_modules code into my AWS functions container, but I understand that defeats the purpose of using a bundler.
An alternative solution would be to include the cacert.pem as a json array (javascript) so it will be automatically packaged, it is not very pretty but would resolve the issue.
It is important to note that the Tinify API client is not intended for use by the frontend (browser) but only in backend code.
Hello, I am getting the following error within AWS Lambda.
It appears that the
cacert.pem
file cannot be found and loaded. Searching around I found this SO question that seems to say that the path setup is incorrect.Client.js
doesn't usepath.join()
as the answer suggestions it should.My code is loading Tinify with a simple import, which seems to be the only difference, but I'm not sure it would matter?
Thank you for the help!