-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: move @payloadcms/ui to peerDependency in plugin-cloud-storage to avoid dep conflict with react-context #13383
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
base: main
Are you sure you want to change the base?
Conversation
…d dep conflict with react-context
My initial thoughts: the root issue likely stems from installing a different version of This happens more frequently in monorepos where package managers sometimes behave in very unpredictable ways. I think eventually this should be fixed by those package managers - in the meantime, webpack aliases could help. This change would force the user to install |
Wouldn’t @payloadcms/ui already be installed by payload itself anyways? I’d argue no one is using this package without also using payload. Having certain payload packages as peer deps with a minimum version needs to be the way to go for any external payload plugins as well. So its something that will occur within the ecosystem either way. |
As far as I understand npm installs peer deps automatically. For |
Agreed. Additionally for me, this occurs in Bun PM with all versions pinned to 3.50.0 . |
@AlessioGr How should we setup dependencies in payload plugins that are not maintained by the payload team? We have opted now to set them up like this:
The reason being that Though this still leads to the aforementioned bug appearing from time to time, at least in our monorepo. What would you suggest we do? |
What?
Fixes a dependency issue inside of
@payloadcms/plugin-cloud-storage
Why?
Bun, NPM and rarely pnpm experience a dependency conflict from
@payloadcms/ui
inside of@payloadcms/plugin-cloud-storage
. The dependency conflict triggers duplicated React Context references causing the admin UI to crash and become inaccessibleHow?
Moves
@payloadcms/ui
out ofdependencies
and intopeerDependencies
&devDependencies
Fixes #
#11717
#13353