When trying to use D3 with Next.js, I cannot get past this error when using D3.js v7.0.0 with Next.js v11.0.1.:
[ERR_REQUIRE_ESM]: Must use import to load ES Module
- I tried
next-transpile-moduleswith no luck - I got D3.js v7.0.0 to work with
create-react-appbut I need D3 working with Next.js v11.0.1
I installed D3.js using npm i d3. I'm importing with import * as d3 from "d3". Using Node v15.8.0 and React v17.0.2