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

react-dnd Module Not Found after upgrading from React 16 to React 17 #3429

Open
NickEmpetvee opened this issue Apr 10, 2022 · 4 comments
Open

Comments

@NickEmpetvee
Copy link

NickEmpetvee commented Apr 10, 2022

I recently upgraded my React project from 16.11 to 17. I'm getting the following error... any help or advice is appreciated:

Description

Compiled with problems:

ERROR in ./node_modules/react-dnd/dist/core/DndProvider.js 39:0-48

Module not found: Error: Can't resolve '<root path>\node_modules\react-dnd\dist\core'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

Reproduction

Steps to reproduce the behavior:

  1. Upgrade to React 17

Expected behavior
The project will compile and this library will work as before.

Desktop (please complete the following information):

  • OS: Win 10
  • Browser Chrome
  • Version 100.0.4896.75
@tyler-dane
Copy link

tyler-dane commented Apr 22, 2022

This has been discussed in these places:
#3433 #3428 #3416 #3418

It seems like a codebase fix hasn't been introduced yet, so the solution is picking one of the workarounds found in those issues or downgrading back to your previously working version

@cwellsx
Copy link

cwellsx commented Jul 10, 2022

The version history for react-dnd says that the latest version i.e. 16.0.0 supports React v18.

Using React v17 in my project, I find it works if I install the previous version of react-dnd i.e.

npm install react-dnd@15.1.2 react-dnd-html5-backend@15.1.2

@hitchcockwill
Copy link

hitchcockwill commented Dec 1, 2022

@cwellsx where exactly do you see that? I see that it supports Node 18 but not seeing any reference to React 18 (or 17) anywhere in the changelogs.

@cwellsx
Copy link

cwellsx commented Dec 2, 2022

@hitchcockwill I don't know where I saw it.
It's mentioned here:

And there appear to be references to react v8 in the yarn.lock

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

No branches or pull requests

4 participants