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

DndProvider breaking the app on latest versions #175

Closed
aaliakseyenka opened this issue Dec 1, 2021 · 4 comments
Closed

DndProvider breaking the app on latest versions #175

aaliakseyenka opened this issue Dec 1, 2021 · 4 comments

Comments

@aaliakseyenka
Copy link

Bug report

  • Package version(s): 5.0.0
  • Browser and OS versions: MacOS, all browsers

Steps to reproduce

  1. npm i react-mosaic-component
  2. create app with basic setup: https://github.com/nomcopter/react-mosaic#apptsx

Actual behavior

App is failed to start wit error:

Could not find the drag and drop manager in the context of DragSource(InternalMosaicWindow). Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context

Expected behavior

works like a magic.

Notes:

  1. everything works with yarn.
  2. if explicitly wrap Mosaic with <DndProvider backend={HTML5Backend}> in own app, everything works as expected.
@Wozniaxos
Copy link

Occured same problem, do you have any update on this? In my case wrapping Mosaic with Dnd won't help

@Wozniaxos
Copy link

Ok, It seems that the problem relies on that yarn has different behavior than npm 7+ and does not install peerDependencies automatically. When I've installed it with the newest npm but with --legacy-peer-deps everything works fine.

@nomcopter
Copy link
Owner

nomcopter commented Jul 29, 2022

Hmm yeah - this is obnoxiously npm 7+ installing peer dependencies and so there are multiple versions of react-dnd in the path. Then their contexts don't talk. I'll try to think of a fix but for now installing with npm install --legacy-peer-deps or yarn fixes this issue.

@nomcopter
Copy link
Owner

nomcopter commented Aug 3, 2022

Fixed in v5.2.2

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

Successfully merging a pull request may close this issue.

3 participants