react-dropzone / file-selector

Convert a DragEvent or file input to a list of File objects
MIT License
95 stars 33 forks source link

Webpack build fails with 0.1.16 #37

Closed danrot closed 4 years ago

danrot commented 4 years ago

Do you want to request a feature or report a bug?

What is the current behavior?

My webpack build is failing with the following error message when using the latest 0.1 version of file-selector (0.1.16):

ERROR in ./node_modules/react-dropzone/dist/es/index.js
Module not found: Error: Can't resolve 'file-selector' in '/home/daniel/Development/sulu/sulu/node_modules/react-dropzone/dist/es'
 @ ./node_modules/react-dropzone/dist/es/index.js 30:0-42 378:61-70
 @ ./src/Sulu/Bundle/MediaBundle/Resources/js/components/SingleMediaDropzone/SingleMediaDropzone.js
 @ ./src/Sulu/Bundle/MediaBundle/Resources/js/components/SingleMediaDropzone/index.js
 @ ./src/Sulu/Bundle/MediaBundle/Resources/js/containers/SingleMediaUpload/SingleMediaUpload.js
 @ ./src/Sulu/Bundle/MediaBundle/Resources/js/containers/SingleMediaUpload/index.js
 @ ./src/Sulu/Bundle/MediaBundle/Resources/js/containers/Form/fields/SingleMediaUpload.js
 @ ./src/Sulu/Bundle/MediaBundle/Resources/js/containers/Form/index.js
 @ ./src/Sulu/Bundle/MediaBundle/Resources/js/index.js
 @ ./index.js                                     
 @ multi ./index.js

After downgrading to file-selector 0.1.13 the build is working again.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Make sure version 0.1.16 is installed
  2. Build your application using webpack
  3. See the error from above

What is the expected behavior?

The build should still be working.

thecodejack commented 4 years ago

same here. Started happening without any changes

olefirenko commented 4 years ago

Experiencing the same issue.

PeterPanen commented 4 years ago

Same issue here

thecodejack commented 4 years ago

also there is weird Semantic version behavior I am observing. Although react-dropzone has ^0.1.12 mentioned this as dependency, it is only trying to resolve to 0.1.16 not 0.2.2.

midudev commented 4 years ago

@thecodejack. versions starting with 0 works differently while using ^ as it only updates the patch versions and not the minor (that will happen with other versions starting with something different to 0).

Example: ^0.1.12 will update to the latest PATCH version 0.1.x. ^1.1.12 will update to the latest MINOR version 1.x.x.

Visual example: image

thecodejack commented 4 years ago

@midudev wow...I didn't realize that... thanks for letting me know...

rolandjitsu commented 4 years ago

Please update to v0.2.2.

midudev commented 4 years ago

@rolandjitsu is not that easy and I would advice to reconsider publishing a PATCH version over the minor version with the fix by cherry picking the commit.

Why? Because other dependencies, like react-dropzone, are using ^0.1.x. https://github.com/react-dropzone/react-dropzone/blob/master/package.json#L94

This is making that react-dropzone is not working anymore for any of their users.

While they could upgrade to 0.2.2 this will make that:

If you just update the latest 0.1.x version with a PATCH, the fix will just be automatically used in the next npm install.

rolandjitsu commented 4 years ago

@midudev true. I'll make a patch for 0.1.

midudev commented 4 years ago

Thank you so much @rolandjitsu 🙇‍♂️ and much appreciated for your work. 👏

rolandjitsu commented 4 years ago

Thank you so much @rolandjitsu 🙇‍♂️ and much appreciated for your work. 👏

No worries, sorry for the mess. Please try again with v0.1.x and let me know if it works.

midudev commented 4 years ago

I can confirm it's working.

I reinstalled react-dropzone@10.2.1 and now everything is working from my end. 👍

danrot commented 4 years ago

Can also confirm that it is working, thank you for fixing it so fast!