Closed namibian15 closed 5 years ago
I'm experiencing a similar issue; I can't tell if it's the same underlying cause.
yarn install
, have it give me an error about upath being incompatible with my version of node (10.14.2). Follow instructions I found here and run yarn install --ignore-engines
. Success.yarn storybook
.yarn build
. Successfully build react-beautiful-dnd.js
, react-beautiful-dnd.min.js
, and react-beautiful-dnd.cjs.js
. Then, observe the following error when attempting to build react-beautiful-dnd.esm.js
: ./src/index.js → dist/react-beautiful-dnd.esm.js... [!] (size-snapshot plugin) Error: ModuleNotFoundError: Module not found: Error: Can't resolve './view/drag-drop-context/index.js' in '/' ModuleNotFoundError: Module not found: Error: Can't resolve './view/draggable/in dex.js' in '/' ModuleNotFoundError: Module not found: Error: Can't resolve './view/droppable/in dex.js' in '/'
Has anyone else run into this issue?
EDIT: For the purposes of getting the library to build, disabling size-snapshot has worked for me as a temporary workaround. I did this by going into rollup.config.js
and commenting out line 115. Weird that it wasn't necessary for the .js
, .min.js
, or .cjs.js
files.
@TrySound I noticed that when I get this error, it's on the size-snapshot plugin. Do you think it this could be caused by something like a versioning compatibility issue? I'm trying to figure out if this is a problem with react-beautiful-dnd, or with rollup-plugin-size-snapshot. What are your thoughts? I'm happy to provide any additional information you may need!
Any thoughts @TrySound ?
Is this still occurring?
@alexreardon yes, It is. Just installed react-beautiful-dnd, on compiling got this:
ERROR in ./node_modules/@babel/runtime-corejs2/core-js/date/now.js Module not found: Error: Can't resolve 'core-js/library/fn/date/now' in '/public_html/ota/gds-pcc/node_modules/@babel/runtime-corejs2/core-js/date' @ ./node_modules/@babel/runtime-corejs2/core-js/date/now.js 1:17-55 @ ./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js
React 16.8.4 Babel 7.3.4 react-beautiful-dnd 10.1.0 Material UI 3.9.2
I am seeing this
Module not found: Error: Can't resolve 'core-js/library/fn/date/now'
when I build the bundle after introducing 'react-beautiful-dnd' into my application.
my webpack config is a little bit different, I am using this plugin "nodeExternals" to basically external all the node module and using whitelist
to only include the ones I want.
externals: [nodeExternals({
whitelist: [
"core-js",
"axios",
"react-beautiful-dnd",
/@babel\/runtime-corejs2/,
"css-box-model",
"memoize-one",
"prop-types",
"raf-schd",
"react-redux",
"redux",
"tiny-invariant",
"regenerator-runtime",
]
})],
after I introduce react-beautifuly-dnd
, I put it and all its dependencies into the white list as well, even the 'core-js`. when I build the bundle file, it's okay. But when I include this bundle into another application, it breaks the build of the other application with the above error.
@TrySound @alexreardon any thoughts on this issue? it's blocking our project right now as we cannot commit any code using the react-beautiful-dnd
as it will break the whole build of the product.
Have you tried deleting node_modules folder and compiling application after npm install
?
Try using 10.1.1. On 10.1.0 and earlier, we found an issue as we had manual dependencies on core-js v3 which conflicted with the core-js v2 dependencies in @babel/runtime-corejs2 and had to override the version of that dependency to 7.4.3.
Overriding internal dependencies is probably asking for trouble
How would you recommend others get around this issue @Catchwa ?
@alexreardon Just try 10.1.1 I guess? This'd explain the comment by @dogrultan that a npm install fixes it (as if you have ^10.1.0 in your package.json you'd get 10.1.1 the next time you do a npm build with an empty node_modules directory). Any runtime-corejs2 >= 7.4.0 should fix this issue per https://github.com/babel/babel/pull/7646
(I can't speak to people/projects that still need core-js v2 though)
I am not sure if there is anything for us to do here. I'll close for now and please reply if you think there is any further action required
I just installed react-beautiful-dnd into my application today, and got this same error.
All I did was npm i react-beautiful-dnd
, then my build had an error like above after importing and trying to use the components.
I deleted node_modules
and npm installed
from scratch, but no luck.
Any ideas? I've no clue.
I'm using React 16.8.6.
Alright, running npm i --save "core-js@^2"
seems to have made the error go away. No idea what it is doing though.
I found that suggestion over at https://github.com/babel/babel/issues/9734.
Bug or feature request?
Bug
Expected behavior
Compile application successfully
Actual behavior
Get the following error: ERROR in ./node_modules/@babel/runtime-corejs2/core-js/date/now.js Module not found: Error: Can't resolve 'core-js/library/fn/date/now' in '\node_modules\@babel\runtime-corejs2\core-js\date'
@ ./node_modules/@babel/runtime-corejs2/core-js/date/now.js 1:17-55
@ ./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js
Steps to reproduce
What version of
React
are you using?16.5.0
What version of
react-beautiful-dnd
are you running?10.0.3
What browser are you using?
Chrome
Demo