[bug] require() of ES modules is not supported
shifengdiy opened this issue · comments
in nodejs12 and higher version, if package.json type="module", all .js files in that package scope as ES modules.
it's not supported require()
please change require into import, or remove type="module"
in /dist file still use require,hope fix it, thanks
I have the same problem. I hope you can solve it
May I ask how you fixed? Asking for a friend 😅
See https://github.com/d3/d3/blob/4c01ba47177e3eb33066f87c835b9e161af1af54/CHANGES.md — there is a link to https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c which gives the rationale. (You can still use an older version.)