Nivo: @nivo/bar misses lodash-es as dependency

Created on 13 Dec 2017  路  9Comments  路  Source: plouc/nivo

Hello,

I've noticed that after installing newest nivo/bar version to the clean create-react-app application and including demo Bar component from the documentation, nivo/bar misses lodash-es as dependency.

Reproduction repo

To reproduce:

  1. create-react-app application
  2. cd application
  3. npm i -S @nivo/bar
  4. add component code
  5. npm start results with:

image

I think the issue might be in babel preset, but I'm not sure.
Adding lodash-es as a dependency to the project, or to nivo/bar package fixes this issue.

bug

Most helpful comment

Something similar for @nivo/line. [email protected] was loaded, but 4.x.x was supposed to be loaded. I npm installed lodash@latest in the root of the app and the problem didn't disappear until I manually modified the path to lodash in compute.js (obviously, that's not a persistent change, because it's in node_modules).

All 9 comments

I present the same problem, i tried importing via npm but it's no works

Looking at bar's package-json file, it doesn't have lodash-es in the dependencies, so I guess that would be the fix.

This same is happening for nivo/circle-packing as well

Same for @nivo/sankey.

Same is true for @nivo/calendar:
image

I don't know nearly enough about Lerna/publishing monorepos like this, but suffice to say I can run make package-dev-calendar from nivo and then yarn link @nivo/calendar from my project and that _does_ work.

Best I can figure at this point is that there's something happening during the publish step since working with it in dev is fine.

Yeah, like I've mentioned in the opening post adding lodash-es as a dependency to the project, or to nivo/bar package fixes this issue, but I think that @plouc uses his own babel-preset that changes declaration.
So like you've said @brandonaaskov running full make and linking works correctly.

Something similar for @nivo/line. [email protected] was loaded, but 4.x.x was supposed to be loaded. I npm installed lodash@latest in the root of the app and the problem didn't disappear until I manually modified the path to lodash in compute.js (obviously, that's not a persistent change, because it's in node_modules).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Haaziq-Uvais picture Haaziq-Uvais  路  3Comments

ellipticaldoor picture ellipticaldoor  路  4Comments

gcloeval picture gcloeval  路  3Comments

serendipity1004 picture serendipity1004  路  3Comments

barnapisti1994 picture barnapisti1994  路  3Comments