react-sortable-hoc
react-sortable-hoc copied to clipboard
Doesn't work with Webpack 5
This project has a dependency on @babel/runtime version 7.2.0 however Webpack 5 has enabled strict mode on ESM module imports which 7.2.0 violates and therefore won't compile. This has already been fixed upstream by 7.12.0 (see discussion here https://github.com/babel/babel/issues/12058), the dependency needs updating in package.json in this repo.
It worked for me after replacing array-move with lodash-move!
A simple workaround for everyone facing the same issue:
Explicitly add the latest version of @babel/runtime to your project: npm i @babel/runtime@latest
If you are doing it, it would be better to update all babel-related packages you are currently using.
Full error (to land Google searches here):
ERROR in ./node_modules/@babel/runtime/helpers/esm/inherits.js 1:0-46
Module not found: Error: Can't resolve './setPrototypeOf' in '/Users/user/project/node_modules/@babel/runtime/helpers/esm'
Did you mean 'setPrototypeOf.js'?
BREAKING CHANGE: The request './setPrototypeOf' failed to resolve only because it was resolved as fully specified
(probably because the origin is 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.
@ ./node_modules/react-sortable-hoc/dist/react-sortable-hoc.esm.js 8:0-60 376:4-13 610:4-13 1520:4-13