react-sortable-tree: Can't resolve 'react-dnd/lib/DragDropContext' with react-dnd@7.1.0
Reporting a Bug?
Can’t resolve ‘react-dnd/lib/DragDropContext’ with react-dnd@7.1.0

react-sortable-tree@2.6.0 code:

react-dnd@7.1.0 looks like changed lib/ directory tree. https://github.com/react-dnd/react-dnd/pull/1205:

react-sortable-tree@2.6.0 package.json,will auto update react-dnd@7.x:
"dependencies": {
"frontend-collective-react-dnd-scrollzone": "^1.0.1",
"lodash.isequal": "^4.5.0",
"prop-types": "^15.6.1",
"react-dnd": "^7.0.1",
"react-dnd-html5-backend": "^7.0.1",
"react-lifecycles-compat": "^3.0.4",
"react-virtualized": "^9.19.1"
}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 15
- Comments: 16 (2 by maintainers)
If you’re using this package in a top-level project, you can use a mechanism like Yarn
resolutionsornpm-force-resolutionsto override the resolved version ofreact-dndand force a good version (like7.0.2).This did not work for my use case, so I’ve published a forked version of this package as a temporary workaround until this issue is fixed:
fixed-react-sortable-treecome on~please fix it~~~😭
It would be great if this was fixed.
Someone probably also should get issue going in
react-dndrepository to exportDragDropConsumerso this issue could be avoided in future. Was not very fun to suddenly not be able to build a project without changing anything. For yarn adding toto
package.jsondid the trick, thanks @quigleyj-mavenomics for pointing this out@wuweiweiwu Will you have time to look on it and eventually publish new version?
We are importing import { Consumer as DragDropContextConsumer } from ‘react-dnd/lib/DragDropContext’; but react-dnd has changed their lib path from react-dnd/lib/DragDropContext to react-dnd/lib/esm/DragDropContext Please fix this
We are also facing the same issue, when can we expect the merge of this PR? Module not found: Error: Can’t resolve ‘react-dnd/lib/DragDropContext’ in ‘/temp/node_modules/react-sortable-tree/dist’