Problem/Motivation
After updating with composer, the Dropzone widget doesn't work and produces he following error:
Warning: file_get_contents(libraries/dropzone/dist/min/dropzone.min.js): failed to open stream: No such file or directory en _locale_parse_js_file() (line 1133 of web/core/modules/locale/locale.module)
Steps to reproduce
In composer.json, set the repository as follows:
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],...and
"installer-paths": {
"web/core": [
"type:drupal-core"
],
"web/libraries/{$name}": [
"type:drupal-library",
"type:bower-asset",
"type:npm-asset"
],Require the library with:
composer require bower-asset/dropzone
It will install the latest version of Dropzone, which will produce the error above
As a temporary workaround force the version inside the composer.json file:
"require": {
"bower-asset/dropzone": "5.7.2",
The widget will work this way but you won't get the latest version.
Proposed resolution
Make the module compatible with the latest version of Dropzone (currently, v5.7.6 Release).
If it is compatible already, please document how to install it.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | Screenshot 2023-02-07 at 11.53.23 AM.png | 49.39 KB | loopy1492 |
Comments
Comment #2
jcmartinezBy the way, installing the composer way, as it is documeted in the README file of the module, didn't work for me.
Comment #3
casaran commentedRelated issue: https://github.com/dropzone/dropzone/issues/1897
Comment #4
brandonratz commentedThis is indeed do to the lack of a
distdirectory in the repo. I'm locking into 5.7.2.I was installing through a composer package repository
Anyone installing should use my method or the above mentioned via
bower-asset/dropzoneThe README.md is out of date and needs patched.
Comment #5
splash112 commentedCan confirm, no more dist directory in the repo nor dropzone.min.js. Any idea which library should be used?
Comment #6
joestewart commentedRequire “npm-asset/dropzone” now instead of “bower-asset/dropzone”.
https://github.com/dropzone/dropzone/issues/1897
( Edit: And *now* I see the issue is mentioned previously.)
Comment #7
alejomc commentedhttps://www.drupal.org/project/dropzonejs/issues/3198420#comment-14016903 worked for me, only had to alter the name:
Comment #8
betoaveigaI'm using drupal/dropzonejs 2.5.0
After reading the comments I was unsure of what to do.
Then I did this...
composer require npm-asset/dropzoneThat command created the dist folder inside the libraries/dropzone that the module is referencing.
And it worked!
PD1: Probably when this issue gets fixed removing that same library is going to be necessary.
PD2: If you are using Lando because you are developing locally then do this:
lando composer require npm-asset/dropzoneComment #9
techwolf12 commentedFor me, removing all other dropzone assets first, then making sure
oomphinc/composer-installers-extenderwas installed. It seems to work with the npm-asset. Be sure to remove the library from your vendor folder if it ends up there prior to reinstalling/upgrading.Comment #10
hussainwebJust going to share my own observations here:
While npm-asset works, I am encouraged to use the official repo (
enyo/dropzone). Yes, that won't be placed in the correct location for Drupal which means we need to write a custom entry in therepositoriessection. One way out would be to support both by checking two paths: the current one which isdist/min/dropzone.min.jsand the one used in the new repo atdist/dropzone-min.js. You can see all the files here: https://github.com/dropzone/dropzone-packagist/tree/master/distComment #11
abelass#3198420-7: Not working with versions of Dropzone library above v5.7.2 worked for me.
Comment #12
socialnicheguru commentedCould what is available in dropzonejs/composer.libraries.json be updated to reflect the newest version?
Comment #13
heddnThis might be a duplicate of #3295283: Installation not working with Dropzone 6. Or, that issue has a solution for the problem stated here.
Comment #14
loopy1492 commentedhttps://github.com/enyo/dropzone now redirects to https://github.com/dropzone/dropzone.
I have added the following to my composer.json:
and
And we are still getting:
When I run composer install, the dropzone library IS in the folder (see the screenshot I am about to attach).
Comment #15
loopy1492 commentedThanks @heddn. I will comment over there as well.
Comment #16
dbetts commentedThis is what we did to solve the problem:
Run
composer require drupal/dropzonejs enyo/dropzoneVisit github and download
https://github.com/enyo/dropzone/archive/v5.9.3.zipExtract that zip file, rename the extracted directory to
dropzoneand place it in theweb/libraries/directory.Visit github and download
https://github.com/enyo/dropzone/releases/download/v5.9.3/dist.zipExtract the zip file and place the
distfolder in theweb/libraries/dropzone/directory.We did not use (we removed) the following from our composer.json file, which we were asked to add when we started the process
No other customizations related to dropzone nor enyo were added to our composer.json file.
Run
composer updateand we no longer saw errors.When we headed on over to the
/admin/modulespath of our website, we were able to install the modules we wanted and no longer saw the error asking for thedropzone.min.jsfile.Comment #17
erutan commentedI tried composer #1 with the npm-asset and it didn't work. Cleaned it up, then just decided to go manual and the following two lines worked:
While hard linking a project URL in composer isn't ideal at least it's a strong reminder that I did it, so I went with an updated version of #7 and #4:
then
composer require drupal/dropzonejs dropzone/dropzoneComment #18
cobenash#17 works for me.
Thanks for @erutan's help. :)
Comment #19
ikeigenwijs commentedI think this issue should be closed, all solutions above did not help
but patch #2 of https://www.drupal.org/project/dropzonejs/issues/3295283
did work
Comment #20
sebastian45 commented#17 works for me.
Thanks @erutan!
Comment #21
berdirYes, closing as duplicate.