-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENOENT: no such file or directory, open '/var/data/geo.dat' when running on AWS lambda #159
Comments
I try to put the library into Lambda Layer, and it is working for me. |
This issue is probably related if not duplicate to #111. |
Running into a similar issue. @monemo12 What does your layer look like for getting this to work in a lambda? Tried doing something like this in cdk
|
Hi @gciluffo, this is my layer and lambda looks like: const lambdaLayerConfig: Pick<
aws_lambda_nodejs.NodejsFunctionProps,
"layers"
> = {
layers: [
new aws_lambda.LayerVersion(this, "SharedPackage", {
code: aws_lambda.Code.fromAsset(
path.join(FUNC_PATH, "genericLayer/layer.zip")
),
compatibleRuntimes: [
aws_lambda.Runtime.NODEJS_14_X,
aws_lambda.Runtime.NODEJS_16_X,
aws_lambda.Runtime.NODEJS_18_X,
],
}),
],
};
const lambda = new fn.Function(this, 'Function', {
........
memorySize: 325,
bundling: {
externalModules: ["geo-tz"],
},
...lambdaLayerConfig, ps. I also adjusted |
Hi 👋🏽 Which packages exactly did you bundle in this layer? How did you create the actual dependencies in the layer? This would help a lot. If we try to bundle all of them we'd have a size of 350 MB which we cannot deploy because the limit is 250 MB. Thank you so much 🙏🏽 |
@monemo12 Thanks for the response. I ended up using an api to get timezone info. We already have a mapbox api integration so just used that. |
For anyone running into this issue who uses CDK, I noticed that including the "bundling" property in my Lambda definition solved the issue for me:
|
Getting the above error when trying to use node-geo-tz in an AWS lambda function.
I've upgraded to the latest version of the library, but the issue still occurs.
Is it possible to get this library to work without having to access the file system?
The text was updated successfully, but these errors were encountered: