-
Notifications
You must be signed in to change notification settings - Fork 359
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
Error: ENOENT: no such file or directory, open '/data/geoip-country.dat' using esbuild #220
Comments
@CodeWithOz Just ran into this myself. You can get around this issue by marking More information on |
in usual cases no additional parameter to config is required, no change of path to webpack is required, no setup as a plugin is required. Try the basics to start with... clean up your node_module folder and run |
I got the same Error. |
I have the same issue, external doesn't work with esbuild |
using
|
For anyone coming to this (reoccurring) issue. |
You can probably set the environment variable |
Webpack can't resolve the paths to the .dat files automatically with NextJS, perhaps because the new global variable option const CopyWebpackPlugin = require("copy-webpack-plugin");
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config, { isServer }) => {
if (isServer) {
config.plugins.push(
new CopyWebpackPlugin({
patterns: [
{
from: "node_modules/geoip-lite/data/geoip-country.dat",
to: "data/geoip-country.dat",
},
{
from: "node_modules/geoip-lite/data/geoip-country6.dat",
to: "data/geoip-country6.dat",
},
],
}),
);
}
return config;
},
};
module.exports = nextConfig; |
You can add flag like |
I get the error
Error: ENOENT: no such file or directory, open '/data/geoip-country.dat
when using esbuild to generate a bundle for my nodejs app. There's already #195 but that was in a webpack setting, and I can't find an equivalent fix using esbuild. I've tried specifying thefile
loader (--loader:.dat=file
) without any luck, and there appears to be no direct esbuild equivalent of the solution that was posted in #195 . Any ideas for how to resolve this problem?The text was updated successfully, but these errors were encountered: