d3 / d3-geo

Geographic projections, spherical shapes and spherical trigonometry.

Home Page:https://d3js.org/d3-geo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting error after updating to latest version

OmerWow opened this issue · comments

Seems like it's related to the new use of modules:

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users//Documents/GitHub//app/node_modules/d3-geo/node_modules/d3-array/src/index.js
require() of ES modules is not supported.
require() of /Users//Documents/GitHub//app/node_modules/d3-geo/node_modules/d3-array/src/index.js from /Users//Documents/GitHub//app/node_modules/d3-geo/dist/d3-geo.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users//Documents/GitHub//app/node_modules/d3-geo/node_modules/d3-array/package.json.