-
Notifications
You must be signed in to change notification settings - Fork 149
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 using geo-tz package #251
Comments
Sounds like a bug, thanks! Can you share the usage that causes it to fail? I tried the following but it worked as expected: const { find } = require('geo-tz');
console.log(find(47.650499, -122.350070)) Here's how it can be tested against nft:
|
I'm not sure what's going on. Following your example I started playing with the nft command line and when I do |
That could be because It would be helpful if you could share the source code that is failing |
EDIT : actually there is already an issue about this problem on |
I think treating
|
Yes that should work, but I want to add an integration test so we don't regress and hopefully be able to fix it properly in the future. So we need to create the failing example. And when I tried this, it doesn't fail:
|
Yep, but as I said it only happens for certain coordinates (as the ones in my previous post, also here is a repro project : https://gitlab.com/leotellier/nft-geotz/-/blob/main/pages/api/geo.js). Be sure to check the last comment (from project owner) in the linked issue on |
Oh I missed that part, thanks! I see now this code fails: const { find } = require('geo-tz');
console.log(find(-21.2377437, 55.48997639438238)) My guess is that the We have some analysis for these cases in wrappers.ts so if we can determine the bundler and the pattern used, we can probably have a more general fix there. Otherwise the quick fix is special-cases.ts like you suggested. |
The |
Ok lets start with special cases and add an integration test to ensure its working 👍 |
Hi, I have Next.js website developed on Vercel and using the
find
method from thegeo-tz
package.But once in production I get
Error: ENOENT: no such file or directory, open '/var/task/node_modules/geo-tz/data/geo.dat'"}
.Seems like this package is to blame as when I build my project the file is not included in
next-server.js.nft.json
file.If this is true, should it be treated as a "special-case" ?
Here the file where the error happens : https://github.com/evansiroky/node-geo-tz/blob/master/src/find.ts
The text was updated successfully, but these errors were encountered: