-
Notifications
You must be signed in to change notification settings - Fork 33
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
ReferenceError: require is undefined #44
Comments
Are you using a code bundler such as webpack or esbuild? If so, add farmhash to its |
According to #44, ensuring farmhash is included in If you're using webpack 5, are you also specifying https://webpack.js.org/configuration/externals/#externalstypenode-commonjs If you're still having problems, please can you share webpack configuration, ideally as a small repo with a minimal set of configuration that allows someone else to reproduce. |
Hello @lovell,
|
hey @lovell, do you have any other recommendations about how to solve this? We're also running into this issue, our build is just installing with |
A small repo with a minimal set of configuration that allows someone else to reproduce would be very useful. |
Closing due to inactivity but, if further help is required, please feel free to reopen with a minimal set of configuration that allows someone else to reproduce |
For anyone else running into this issue -
While attempting to use this module from an ES6 module, (
type: "module"
in package.json) I get the following error:This corresponds to the require code here -
farmhash/index.js
Line 5 in 2325f1e
I attempted to add a
type: "commonjs"
key to the farmhash package.json but that didn't help.I was able to get past the error by importing farmhash using:
I'm not too sure how to fix the issue since I was unable to get the package to build in my fork. But hopefully this helps.
The text was updated successfully, but these errors were encountered: