drupal-composer / drupal-project

:rocket: Composer template for Drupal projects. Quick installation via "composer create-project drupal-composer/drupal-project"
GNU General Public License v2.0
1.56k stars 941 forks source link

Issue with vlucas/phpdotenv and Composer 2.2 #608

Closed tstoeckler closed 1 year ago

tstoeckler commented 2 years ago

Due to https://github.com/composer/composer/pull/10065 Composer will now require any files specified as part of the autoloader when executing scripts and plugins, so in particular for this repo this that means load.environment.php will be loaded when the composer/installers plugin is installed, which might be before vlucas/phpdotenv is installed. Requiring the file then results in

Fatal error: Uncaught Error: Class 'Dotenv\Dotenv' not found in .../load.environment.php:14

Probably checking class_exists() and just bailing if that's false is fine? But not sure...

edurenye commented 2 years ago

Got the same error, for now my workaround is to stick with version 2.1.14.

mroest commented 2 years ago

Same issue here...

edurenye commented 2 years ago

This seem to have been fixed in https://github.com/composer/composer/issues/10382, you can test using composer self-update --snapshot. At least it worked for me.