Problem/Motivation

When running any Drush command, the following error appears:

The command defined in "Symfony\Component\Dotenv\Command\DotenvDumpCommand" cannot have an empty name.

Steps to reproduce

Make sure drupal/dotenv ^1.1 and symfony/dotenv ^6.0 are installed. Run any Drush command.

Proposed resolution

?

Issue fork dotenv-3331051

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 3331051 Comparecompare

Comments

DieterHolvoet created an issue. See original summary.

dieterholvoet’s picture

Turns out that in the dotenv:dump Symfony Console command $defaultName and $defaultDescription is converted to an Use #[AsCommand] attribute in symfony/dotenv 6.2.0, which causes the name and description for this command to not be picked up anymore.

I'm afraid we'll have to revert #3296179: Update symfony/dotenv to ^6.0 unless we can come up with a quick solution for this problem.

dieterholvoet’s picture

I just tested and this issue doesn't happen when using Drupal 10. Seems like we just can't use symfony/dotenv ^6.0 in combination with drupal/core 9.1.

  • DieterHolvoet committed 8a3fed90 on 1.1.x
    Issue #3331051 by DieterHolvoet: The command defined in "Symfony\...
dieterholvoet’s picture

Status: Active » Fixed
lukas.fischer’s picture

I just ran into this issue. I use Drupal 9.5 - and I just saw the box on the project page...

composer require drupal/dotenv:~1.0.0 --update-with-all-dependencies
solved the problem for me

  • DieterHolvoet committed 393ac465 on 1.1.x
    Revert "Issue #3331051 by DieterHolvoet: The command defined in "Symfony...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.