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

image

react-sortable-tree@2.6.0 code:

image

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

image

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)

Most upvoted comments

If you’re using this package in a top-level project, you can use a mechanism like Yarn resolutions or npm-force-resolutions to override the resolved version of react-dnd and force a good version (like 7.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-tree

come on~please fix it~~~😭

It would be great if this was fixed.

Someone probably also should get issue going in react-dnd repository to export DragDropConsumer so 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 to

 "resolutions": {
    "react-sortable-tree/**/react-dnd": "7.0.2"
  }

to package.json did 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 image

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’