ux: Can't upgrade 2.8.1 packages to 2.9.0

I’m not sure if the issue is with my setup, the new symfony/stimulus-bundle, or UX, but my service container won’t build with any UX 2.9.0 packages installed. I can explicitly require symfony/stimulus-bundle 2.9.0 with UX 2.8.1 packages and all is fine, but upgrading UX packages results in service resolution errors.

composer.json:

image

Running a composer update results in:

  Gathering patches from patch file.
  Loading composer repositories with package information
  Restricting packages listed in "symfony/symfony" to "^6"
  Updating dependencies
  Lock file operations: 1 install, 6 updates, 0 removals
    - Upgrading symfony/flex (v2.3.0 => v2.3.1)
    - Locking symfony/stimulus-bundle (v2.9.0)
    - Upgrading symfony/ux-chartjs (v2.8.1 => v2.9.0)
    - Upgrading symfony/ux-dropzone (v2.8.1 => v2.9.0)
    - Upgrading symfony/ux-live-component (v2.8.1 => v2.9.0)
    - Upgrading symfony/ux-notify (v2.8.1 => v2.9.0)
    - Upgrading symfony/ux-turbo (v2.8.1 => v2.9.0)
  Writing lock file
  Installing dependencies from lock file (including require-dev)
  Package operations: 1 install, 6 updates, 0 removals
    - Downloading symfony/flex (v2.3.1)
    - Downloading symfony/stimulus-bundle (v2.9.0)
    - Downloading symfony/ux-chartjs (v2.9.0)
    - Downloading symfony/ux-dropzone (v2.9.0)
    - Downloading symfony/ux-live-component (v2.9.0)
    - Downloading symfony/ux-notify (v2.9.0)
    - Downloading symfony/ux-turbo (v2.9.0)
  Gathering patches from patch file.
  Gathering patches for dependencies. This might take a minute.
    - Upgrading symfony/flex (v2.3.0 => v2.3.1): Extracting archive
    - Installing symfony/stimulus-bundle (v2.9.0): Extracting archive
    - Upgrading symfony/ux-chartjs (v2.8.1 => v2.9.0): Extracting archive
    - Upgrading symfony/ux-dropzone (v2.8.1 => v2.9.0): Extracting archive
    - Upgrading symfony/ux-live-component (v2.8.1 => v2.9.0): Extracting archive
    - Upgrading symfony/ux-notify (v2.8.1 => v2.9.0): Extracting archive
    - Upgrading symfony/ux-turbo (v2.8.1 => v2.9.0): Extracting archive
  Package fgrosse/phpasn1 is abandoned, you should avoid using it. No replacement was suggested.
  Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.
  Generating optimized autoload files
  157 packages you are using are looking for funding.
  Use the `composer fund` command to find out more!
  Endroid Installer detected project type "symfony"
  
  What about running composer global require symfony/thanks && composer thanks now?
  This will spread some 💖  by sending a ★  to the GitHub repositories of your fellow package maintainers.
  
  Run composer recipes at any time to see the status of your Symfony recipes.
  
  Executing script cache:clear [KO]
   [KO]
  Script cache:clear returned with error code 255
  !!  Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException {#16135
- !!    #message: "The service "chartjs.twig_extension" has a dependency on a non-existent service "stimulus.helper"."
  !!    #code: 0
  !!    #file: "/data/app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php"
  !!    #line: 83
  !!    -id: "stimulus.helper"
  !!    -sourceId: "chartjs.twig_extension"
  !!    -alternatives: []
  !!    trace: {
  !!      /data/app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:83 { …}
  !!      /data/app/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:80 { …}
  !!      /data/app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:46 { …}
  !!      /data/app/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:89 { …}
  !!      /data/app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:46 { …}
  !!      /data/app/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:80 { …}
  !!      /data/app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:46 { …}
  !!      /data/app/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:44 { …}
  !!      /data/app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:37 { …}
  !!      /data/app/vendor/symfony/dependency-injection/Compiler/Compiler.php:73 { …}
  !!      /data/app/vendor/symfony/dependency-injection/ContainerBuilder.php:721 { …}
  !!      /data/app/vendor/symfony/http-kernel/Kernel.php:499 { …}
  !!      /data/app/vendor/symfony/http-kernel/Kernel.php:721 { …}
  !!      /data/app/vendor/symfony/http-kernel/Kernel.php:123 { …}
  !!      ./src/App/Kernel.php:66 {
  !!        Moyer\App\Kernel->boot(): void
  !!        › {
  !!        ›     parent::boot();
  !!        › 
  !!      }
  !!      ./bin/console:44 { …}
  !!    }
  !!  }
  !!  2023-05-27T19:09:41+00:00 [critical] Uncaught Exception: The service "chartjs.twig_extension" has a dependency on a non-existent service "stimulus.helper".
  !!  
  Script @auto-scripts was called via post-update-cmd

Whereas this configuration works:

image

  Gathering patches from patch file.
  Loading composer repositories with package information
  Restricting packages listed in "symfony/symfony" to "^6"
  Updating dependencies
  Lock file operations: 1 install, 1 update, 0 removals
    - Upgrading symfony/flex (v2.3.0 => v2.3.1)
    - Locking symfony/stimulus-bundle (v2.9.0)
  Writing lock file
  Installing dependencies from lock file (including require-dev)
  Package operations: 0 installs, 1 update, 0 removals
  Gathering patches from patch file.
  Gathering patches for dependencies. This might take a minute.
    - Upgrading symfony/flex (v2.3.0 => v2.3.1): Extracting archive
  Package fgrosse/phpasn1 is abandoned, you should avoid using it. No replacement was suggested.
  Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.
  Generating optimized autoload files
  157 packages you are using are looking for funding.
  Use the `composer fund` command to find out more!
  Endroid Installer detected project type "symfony"
  
  What about running composer global require symfony/thanks && composer thanks now?
  This will spread some 💖  by sending a ★  to the GitHub repositories of your fellow package maintainers.
  
  Run composer recipes at any time to see the status of your Symfony recipes.
  
+ Executing script cache:clear [OK]
  Executing script assets:install public [OK]
  
  No security vulnerability advisories found

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 20 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Hmm. That’s super weird, that service comes from stimulus bundle. It looks like the StimulusBundle recipe isn’t running, so (and please confirm), the bundle isn’t being registered in bundles.php. Does that look correct? Is symfony.lock updated?

if you do another composer update, does the recipe install? I noticed a bug recently where flex seems to skip recipe installs if flex is also upgraded at the same time. To test, you could go back to your original state, use symfony/flex only and then upgrade everything else. Does it work then?

For others, I think a workaround would be to run:

composer recipes:install symfony/stimulus- bundle --force

after you get this error. If… my guesses are correct 😃.