-
Notifications
You must be signed in to change notification settings - Fork 17
Description
I am trying to use this library in a netsjs project doing an import like this:
import * as rangeCheck from 'range_check';
and then calling functions like
rangeCheck.isIP(address)
but when trying to run the project i get this error
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/mono/Projects/UDT/content-filtering/bitdeflect-portal/node_modules/.pnpm/ip6@0.2.11/node_modules/ip6/ip6.js from /home/mono/Projects/UDT/content-filtering/bitdeflect-portal/node_modules/.pnpm/range_check@4.1.0/node_modules/range_check/dist/index.js not supported.
Instead change the require of ip6.js in /home/mono/Projects/UDT/content-filtering/bitdeflect-portal/node_modules/.pnpm/range_check@4.1.0/node_modules/range_check/dist/index.js to a dynamic import() which is available in all CommonJS modules.
at Module.load (/home/mono/Projects/UDT/content-filtering/bitdeflect-portal/node_modules/.pnpm/@nx+js@20.4.4@babel+traverse@7.25.9_@swc-node+register@1.9.2_@swc+core@1.5.29_@swc+hel_33f44497903549cde5f0e65f0aa60c0e/node_modules/@nx/js/src/executors/node/node-with-require-overrides.js:18:31)
at Object. (/home/mono/Projects/UDT/content-filtering/bitdeflect-portal/node_modules/.pnpm/range_check@4.1.0/node_modules/range_check/dist/index.js:49:26)