Not working with versions of Dropzone library above v5.7.2

Created on 14 February 2021, almost 4 years ago
Updated 28 February 2024, 10 months ago

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.

πŸ› Bug report
Status

Closed: duplicate

Version

2.4

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jcmartinez Raleigh, NC, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States loopy1492

    https://github.com/enyo/dropzone now redirects to https://github.com/dropzone/dropzone.

    I have added the following to my composer.json:

            "dropzone": {
                "type": "package",
                "package": {
                    "name": "dropzone/dropzone",
                    "version": "v5.9.3",
                    "type": "drupal-library",
                    "dist": {
                        "url": "https://github.com/dropzone/dropzone/archive/refs/tags/v5.9.3.zip",
                        "type": "tar"
                    }
                }
            },
    

    and

    
            "dropzone/dropzone": "v5.9.3",
    

    And we are still getting:

    DROPZONE LIBRARY MISSING
    Dropzonejs requires the dropzone.min.js library. Download it (https://github.com/enyo/dropzone) and place it in the libraries folder (/libraries)

    When I run composer install, the dropzone library IS in the folder (see the screenshot I am about to attach).

  • πŸ‡ΊπŸ‡ΈUnited States loopy1492

    Thanks @heddn. I will comment over there as well.

  • This is what we did to solve the problem:

    Run composer require drupal/dropzonejs enyo/dropzone

    Visit github and download https://github.com/enyo/dropzone/archive/v5.9.3.zip
    Extract that zip file, rename the extracted directory to dropzone and place it in the web/libraries/ directory.

    Visit github and download https://github.com/enyo/dropzone/releases/download/v5.9.3/dist.zip
    Extract the zip file and place the dist folder in the web/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

        "extra": {
            "merge-plugin": {
                "include": [
                    "web/modules/contrib/dropzonejs/composer.libraries.json"
                ]
            }
        }

    No other customizations related to dropzone nor enyo were added to our composer.json file.

    Run composer update and we no longer saw errors.
    When we headed on over to the /admin/modules path of our website, we were able to install the modules we wanted and no longer saw the error asking for the dropzone.min.js file.

  • πŸ‡ΊπŸ‡ΈUnited States erutan

    I 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:

    /web/libraries$ wget https://github.com/dropzone/dropzone/releases/download/v5.9.3/dist.zip
    unzip dist.zip 

    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 πŸ› Not working with versions of Dropzone library above v5.7.2 Needs review and #4 πŸ› Not working with versions of Dropzone library above v5.7.2 Needs review :

    {
    	"type": "package",
    	"package": {
    		"name": "dropzone/dropzone",
    		"version": "5.9.3",
    		"type": "drupal-library",
    		"extra": {
    			"installer-name": "dropzone/dist"
    		},
    		"dist": {
    			"url": "https://github.com/dropzone/dropzone/releases/download/v5.9.3/dist.zip",
    			"type": "zip"
    		}
    	}
    },
    

    then composer require drupal/dropzonejs dropzone/dropzone

  • πŸ‡ΉπŸ‡ΌTaiwan cobenash Taipei

    #17 works for me.

    Thanks for @erutan's help. :)

  • Status changed to Needs review about 1 year ago
  • πŸ‡§πŸ‡ͺBelgium ikeigenwijs

    I think this issue should be closed, all solutions above did not help

    but patch #2 of https://www.drupal.org/project/dropzonejs/issues/3295283 πŸ“Œ Installation not working with Dropzone 6 Needs review

    did work

  • #17 works for me.

    Thanks @erutan!

  • Status changed to Closed: duplicate 10 months ago
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    Yes, closing as duplicate.

Production build 0.71.5 2024