Open tveryakoff opened 11 months ago
If it's OK with your setup and guidelines, you can add shamefully-hoist=true
to your Sanity Studio's .npmrc
in order to resolve the packages until a fix is provided.
https://pnpm.io/npmrc#shamefully-hoist
You can be more specific than "shamefully" with the other settings mentioned here: https://pnpm.io/npmrc#dependency-hoisting-settings.
I'm experiencing the same issue. Unfortunately, the proposed fix doesn't seem to do anything in my case.
Here is what did the trick for me (using pnpm as the package manager and an embedded sanity studio)
In my package.json (in my case, it's a monorepo, so it is at the root level package.json), I added
"pnpm": {
"overrides": {
"react-dnd": "^14.0.5",
"react-dnd-html5-backend": "^14.1.0"
}
}
This enforces the specified version across all dependencies and sub-dependencies. No need to change settings in the .npmrc
.
To me it looks like a better fix would be to fix the version numbers in the package.json of this package. This package seems to be incompatible with versions >14 of react-dnd.
Describe the bug
Crashes due to unresolved
DragSource
import:To Reproduce
dependencies:
Description
@sanity/hierarchical-document-list has
@nosferatu500/react-sortable-tree
and"react-dnd": "16.0.1"
in dependencies, however@nosferatu500/react-sortable-tree
expects react-dnd@14 in peerDependencies, which causes a crash due to failed imports from react-dndExpected behavior Plugin is compatible with react-dnd@16.x or has react-dnd@14 in dependencies
Full error log