d3 not loaded when using require?
hyperborea opened this issue · 2 comments
I'm trying to load d3kit-timeline through require (NPM), but get the following error:
"Cannot read property 'scale' of undefined"
Also https://tonicdev.com/npm/d3kit-timeline doesn't work, likely the same issue.
It seems that d3 is not loaded correctly, is there possibly something wrong in the dependency definition? I haven't had time yet to dig deeper, but could this be related to d3/d3#1693 or d3/d3#2615?
Which version of d3 are you using?
D3 just release version 4, with a lot of API changes, which may be the reason.
Could you explicitly state "d3": "~3.5.17" as dependency in the package.json, npm install and try again?
Spot on, I was using 4.1.0, after downgrading to v3 everything was working fine. Thanks!