Skip to content
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

[BUG] - provide or delegate peer dependencies #1669

Closed
akomm opened this issue Sep 21, 2023 · 0 comments · Fixed by #1651
Closed

[BUG] - provide or delegate peer dependencies #1669

akomm opened this issue Sep 21, 2023 · 0 comments · Fixed by #1651
Labels
🐛 Type: Bug Something isn't working

Comments

@akomm
Copy link

akomm commented Sep 21, 2023

NextUI Version

2.1.13

Describe the bug

The following warnings (yarn berry):
grafik

This warnings won't resolved by adding the dependencies at the root. In fact the above warnings come with the peer dependencies being installed at root, as you can reproduce in reproduction below.

This is not an error of yarn (berry), the manager just makes the problem visible.

Your Example Website or App

reproduction with blank project see below ~1minute or video

Steps to Reproduce the Bug or Issue

That is a general problem, but depending on package manager you might not see it, hence use yarn berry

mkdir test
cd test
yarn set version berry
yarn add @nextui-org/react react react-dom framer-motion

Expected behavior

No peer dependency warnings.

I explain why this is a problem and you should care:

First and basic: warnings should not be stacked up and ignored or they lose any meaning. I have dozens of libraries added with peer dependencies, none generating peer warnings. This was a bit different just a year or two ago, but many libraries have fixed that by now.

One example of those fixed is the remix-run library (issue fixed). I've reported this problem early there, initially not picked up, there were some other issues later on which could be traced back to this problem.

The problem and solution:
grafik

Here @nextui-org/button and card depend on @nextui-org/ripple. ripple depends (peer) on framer-motion. Button and card need to either 1. provide framer-motion as dependency or 2. add framer-motion as peer, basically delegating it further up to the next library that uses it.

Screenshots or Videos

peer-nextui.webm

ps. Issue also using nodeLinker: node-modules (so you can ignore the PnP experimental warning)

Operating System Version

linux

Browser

Chrome

@akomm akomm added the 🐛 Type: Bug Something isn't working label Sep 21, 2023
@akomm akomm changed the title [BUG] - specify or delegate peer dependencies [BUG] - provide or delegate peer dependencies Sep 21, 2023
@jrgarciadev jrgarciadev linked a pull request Sep 23, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant