plouc / nivo

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries
https://nivo.rocks
MIT License
13.19k stars 1.03k forks source link

Compilation error without an explicit dependency on @nivo/core #1309

Closed benrhere closed 3 years ago

benrhere commented 3 years ago

Thanks for using nivo

Before creating an issue...

Are you asking a question?

Please don't file GitHub issues to ask questions. Try to use the discord channel first: https://discord.gg/n7Ft74f.

Describe/explain the bug According to the readme: "In order to use nivo, you just have to pick the scoped @nivo packages according to the charts you wish to use."

This used to be true. But starting recently (not sure of the exact version), I have had to take an explicit dependency on "@nivo/core" in my package.json. If I do not, this package does not get installed and then when I run webpack I get:

ERROR in ./node_modules/@nivo/annotations/dist/nivo-annotations.es.js 6:0-149
Module not found: Error: Can't resolve '@nivo/core' in '[project_folder]\node_modules\@nivo\annotations\dist'

ERROR in ./node_modules/@nivo/axes/dist/nivo-axes.es.js 3:0-74
Module not found: Error: Can't resolve '@nivo/core' in '[project_folder]\node_modules\@nivo\axes\dist'

ERROR in ./node_modules/@nivo/bar/dist/nivo-bar.es.js 3:0-234
Module not found: Error: Can't resolve '@nivo/core' in '[project_folder]\node_modules\@nivo\bar\dist'

ERROR in ./node_modules/@nivo/legends/dist/nivo-legends.es.js 3:0-38
Module not found: Error: Can't resolve '@nivo/core' in '[project_folder]\node_modules\@nivo\legends\dist'

ERROR in ./node_modules/@nivo/pie/dist/nivo-pie.es.js 2:0-332
Module not found: Error: Can't resolve '@nivo/core' in '[project_folder]\node_modules\@nivo\pie\dist'

ERROR in ./node_modules/@nivo/tooltip/dist/nivo-tooltip.es.js 3:0-86
Module not found: Error: Can't resolve '@nivo/core' in '[project_folder]\node_modules\@nivo\tooltip\dist'

Also interesting: when I point to the latest @nivo/core (0.66.0) I get several of these warnings on npm install: npm WARN @nivo/bar@0.66.0 requires a peer of @nivo/core@0.65.0 but none is installed. You must install peer dependencies yourself.

To Reproduce

Expected behavior A core folder should be present, I believe, without an explicit dependency on this package, or the documentation should be updated.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

plouc commented 3 years ago

@benrhere, yes, @nivo/core is now a required dependency, and you should get warnings about it when installing, it's indicated in the generated code snippets on the website.

plouc commented 3 years ago

I also updated the README, we overlooked this one, thank you!