Change devDependency to dependency
See original GitHub issueYou have d3-scale
as a devDependency
for nivo legends https://github.com/plouc/nivo/blob/master/packages/legends/package.json#L27
When we try to run your basic “hello world” examples we got:
Cannot find module 'd3-scale' from '../../node_modules/@nivo/legends/dist/nivo-legends.cjs.js'
Require stack:
/my-project/node_modules/@nivo/legends/dist/nivo-legends.cjs.js
/my-project/node_modules/@nivo/line/dist/nivo-line.cjs.js
This should be moved to dependency
or added as a peerDependency
(preferably the former), otherwise it requires the user of Nivo to debug this. Naively one may try to install d3-scale
in their package.json
which will cause even more issues since the latest major version of said package is relying on experimental node features which will throw nonsensical errors taking the user further down the rabbit hole.
I believe this one small fix will greatly improve the DX for this library.
The code you publish in your dist
for legends
does a require("d3-scale")
so this is not a devDependency
.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:7 (4 by maintainers)
Top GitHub Comments
This only worked for me if declared as
peerDependencies
(possibly because I had both of them as dependencies in mypackage.json
already):Bump