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

Dayjs is not peer dependency anymore, breaks registration of plugins in client app that has also the dependency #329

Closed
sanderdewilde opened this issue Dec 21, 2021 · 2 comments

Comments

@sanderdewilde
Copy link

Hi,

We have a design system library we use to support our applications. This library uses ant which uses rc-picker. We re-generate the pickers using ant, with dayjs instead of moment. In this library, we mark dayjs as a peer dependency. We also install it in our main applications where we register multiple plugins on the singleton dayjs instance. This has been made possible through #214.

However, since #270 our workflow has been broken. Since dayjs is included as a dependency here, the build of our design system library causes a dayjs singleton to be created, as does our main app. Therefore we have two singletons, and the plugins are only registered on one of them.

@sanderdewilde
Copy link
Author

sanderdewilde commented Jan 3, 2022

I was able to work around the problem by using webpack aliasing as described here: https://blog.maximeheckel.com/posts/duplicate-dependencies-npm-link/.

I stumbled upon this by upgrading my npm version to 7+. Since npm7, peerDeps are also automatically installed which caused the same problem to appear even without the changes of #270.

@deathemperor
Copy link

Got the same issue, fix it with yarn resolutions config for anyone googling this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants