-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.83.0 Doesn't work with pnpm + webpack #2401
Comments
I've hit that too. Exactly same symptoms, within a nextjs 13 (.4 and .5) application. Stack uses typescript as well (bundler module resolution). Switching to npm fixed it, but led me into a conendrum of trying to adjust our yarn/pnpm monorepo into an hybrid. Gave up and decided of not using nivo on this project for now as we're still prototyping. Really interested to get to the bottom of it and subscribed to the issue. |
Same issue here. Getting a lot of undefined errors around the useMotionConfig() hook. |
The same issue happens with Yarn 3 (Berry / PnP) |
Same issue, and, except for chrome, exact same env |
Likewise, yarn + nextjs13. I've tried resolving dependencies in yarnrc but am coming up blank. |
same issue here after upgrade to react 18 and yarn 3. any updates or workarounds? |
@OsmelSynData unfortunately the workaround for me was to postpone upgrading Nivo. We are still on 0.69.1. I wonder if some dependency graph too like https://github.com/pahen/madge could point to where a different version of React is getting pulled in, or something... 🤔 |
Well actually, I managed to find work around the problem by not upgrading to yarn berry. "@nivo/core": "0.83.0" Seems to be working really smoothly actually. Hope this works! |
I have the same issue with Yarn 4 and Plug'n'Play – when using the |
Same here... so we can't use the lib. |
….yml` * Fixes plouc/nivo#2401 (for whatever reason) Signed-off-by: Marvin A. Ruder <signed@mruder.dev>
* Add peer dependencies of `@nivo/core` as its dependencies in `.yarnrc.yml` as a workaround for plouc/nivo#2401 (no idea why this works) Signed-off-by: Marvin A. Ruder <signed@mruder.dev>
It would appear that at least for Yarn PnP a workaround is to add all peer dependencies of packageExtensions:
"@nivo/core@*":
dependencies:
prop-types: "*"
react: "*" Allow me to explain. While analyzing this issue, I realized that the Chrome debugger showed two instances of the
(One can observe the different virtual packages by looking into the So although those different paths are pointing to the exact same source code, they are not treated as the same thing in the browser, which led to Depending on the packageExtensions:
"@nivo/tooltip@*":
peerDependencies:
react: "*" I am not sure whether this is a bug in the (peer) dependency configuration of |
And since we are already talking about (peer) dependencies: Working with
But I added In the case of this repository, every package depending on (This requirement would then also extend to all transitive dependencies: |
@marvinruder this is a great insight into the problem. Thank you for the time spent digging into this! |
* Fix (peer) dependencies * Declare `prop-types` as a dependency of `@nivo/core` (as recommended in their README) * Declare `react` as a peer dependency of `@nivo/tooltip` * Update lockfile Fixes #2401 Signed-off-by: Marvin A. Ruder <signed@mruder.dev> * Use and declare the same `pnpm` version as `ci/codesandbox` uses Signed-off-by: Marvin A. Ruder <signed@mruder.dev> --------- Signed-off-by: Marvin A. Ruder <signed@mruder.dev>
i am having this issue too. any time i hover over a chart now it breaks the page and throws this console error. i just upgraded to react 18. will try downgrading to an earlier version for now, but please fix. |
@SteveAtKlover Which version of |
@marvinruder using files attached |
Thanks! I see nothing wrong with the dependencies themselves, only one version of Which package manager are you using (I tested with pnpm@8)? Maybe you can create and share an MWE setup reproducing the issue? |
I'm using npm. I'll see if I can spin something up
…On Thu, Mar 28, 2024, 1:26 PM Marvin A. Ruder ***@***.***> wrote:
@marvinruder <https://github.com/marvinruder> using 0.85.1
files attached package-lock.json
<https://github.com/plouc/nivo/files/14794656/package-lock.json>
package.json <https://github.com/plouc/nivo/files/14794657/package.json>
Thanks! I see nothing wrong with the dependencies themselves, only one
version of react (18.2.0) is pulled in. I quickly combined your
dependencies with Nivo's example setup
<https://github.com/plouc/nivo/tree/master/examples/codesandbox> and
experienced no issues at all.
Which package manager are you using (I tested with ***@***.***)? Maybe you can
create and share an MWE setup reproducing the issue?
—
Reply to this email directly, view it on GitHub
<#2401 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYDS5DEBVU2MAHKSRMGSW53Y2RVFVAVCNFSM6AAAAAA22EZMC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRWGA2TINJWHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
For those coming through now, I saw this error when I accidentally installed @nivo/core version 0.85.1 and @nivo/pie version 0.86.0. Just give a quick check for dependencies between various @nivo/* dependencies to make sure all match. |
Describe/explain the bug
When using 0.83.0 with wepback + pnpm, something goes wrong in the dep tree, and the result is that all the Container.js contexts hooks produce undefined values wherever they are called, resulting in lots of runtime errors and blank charts.
Runtime Errors are like
To Reproduce
Does not reproduce using npm, but switching this repo from
npm
topnpm
reproduced it immediately.https://github.com/ollwenjones/nivo-0830-test
Expected behavior
Since nivo uses pnpm internally (per contributing page) one would expect it to work with pnpm
Screenshots
Desktop (please complete the following information):
Additional context
Really tried to solve this, and will contribute a fix if I can figure it out, but had to timebox it. My guess is some dependency problem caused by pnpm isolating modules is being masked by these react-contexts-are-blank runtime errors. Tried to find a duplicate version of React, but was unable to in the time that I had.
The text was updated successfully, but these errors were encountered: