selectize / selectize.js

Selectize is the hybrid of a textbox and <select> box. It's jQuery based, and it has autocomplete and native-feeling keyboard navigation; useful for tagging, contact lists, etc.
https://selectize.dev/
Apache License 2.0
13.03k stars 3.57k forks source link

Docker NPM Install Error: `require.@selectize/selectize is invalid` #1826

Closed dan-burt closed 2 years ago

dan-burt commented 2 years ago

I did:

Adding Selectize.js to an existing Docker container config, to add this feature to a data entry form. Errors with the Composer container.

Steps to reproduce:

  1. The docker-compose.yml config is:2.
version: '2'

services:
  webapp:
    image: redswitch/php-mongodb:8.0-1.13.0
    container_name: webapp
    volumes:
      - ./html:/var/www/html
      - ./php/mongodb.php.ini:/usr/local/etc/php/conf.d/mongodb.php.ini
    restart: always
    environment:
      - VIRTUAL_HOST=app.domain.com
      - LETSENCRYPT_HOST=app.domain.com
      - LETSENCRYPT_EMAIL=webmaster@domain.com
      - "TZ=Europe/London"
    ports:
      - 80
    expose:
      - 80
    restart: unless-stopped

  composer:
    image: composer:2.3
    command: ["composer", "install"]
    volumes:
      - ./html:/app

networks:
  default:
    external:
      name: nginx-proxy-net
  1. The composer.json config (and ensured there is no composer.lock file either, to force redeploying the NPM installs):3.
{
    "require": {
        "mongodb/mongodb": "^1.8.0",
        "vlucas/phpdotenv": "^5.3.0",
        "auth0/auth0-php": "^7.9.0",
        "@selectize/selectize": "^0.13.5"
    },
    "provide" : {
        "ext-mongodb": "*"
    }
}
  1. docker-compose up -d to start the comtainers. The composer container only runs to deploy the packages then ends. The webapp container remains and should run my web app. This is sat behind an NGinx proxy for SSL certs and routing.

Expected result: Running web app with the Selectize.js component available for use.

Actual result: The following error appears in the composer container's log:

, In RootPackageLoader.php line 162:, , require.@selectize/selectize is invalid, it should have a vendor name, a fo , rward slash, and a package name. The vendor and package name can be words s , eparated by -, . or . The complete name should match "^[a-z0-9]([.-]?[a-z , 0-9]+)/a-z0-9$". , , , install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [...], ,

If I try to use the cdnjs scripts instead, I get a permission error, but would prefer to use NPM, as I have other modules that install via this method without issue.

risadams commented 2 years ago

Please See discussion #1825