Accueil
Patrice Bridoux - Coach informatique
Pour une meilleure maitrise de vos ordinateurs et de votre vie numérique

Composer

Problème twig ce matin (26 sept. 2026)

OK, tout ça aurait pu être dans la page Drupal, mais bon... Je teste les mises à jour d'un Drupal donc.

$ composer update -W --dry-run
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
 - Upgrading twig/twig (v3.29.0 => v3.30.0)
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
 - Upgrading twig/twig (v3.29.0 => v3.30.0)
102 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.

Pas de problème à prioiri, alors j'y vais.

$ composer update -W
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
 - Upgrading twig/twig (v3.29.0 => v3.30.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
 - Upgrading twig/twig (v3.29.0 => v3.30.0): Extracting archive
Generating autoload files
102 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
phpstan/extension-installer: Extensions installed
No security vulnerability advisories found.

$ ./vendor/bin/drush cr
[success] Cache rebuild complete.

Mais quand je veux charger le site j'obtiens une erreur.

Le site Web a rencontré une erreur inattendue.The website encountered an unexpected error. Try again later.

Les logs d'apache sont un peu plus bavards.

[Sat Sep 26 09:58:53.194016 2026] [php:notice] [pid 10049:tid 10049] [client 127.0.0.1:40360] Uncaught PHP Exception TypeError: "Twig\\Runtime\\EscaperRuntime::escape(): Argument #4 ($autoescape) must be of type bool, null given, called in /.../web/sites/default/files/php/twig/6ab77b3d11661_field--node--title.html.t_JNBMP6rpmDTiiw2hKbW7pS_U1/i6LD1IXFkXkkdTjp974UL0CwUP3YtVNuRLiFcgJyQVk.php on line 58" at /.../vendor/twig/twig/src/Runtime/EscaperRuntime.php line 94

Je fouille le web, avec un système d'IA, c'est décidément bien pratique ces trucs là. Il me dit que le problème est à priori déjà connu et que le mieux est de faire marche arrière pour le moment. Il me donne même les instructions pour le faire, instructions qui me semblent raisonnables.

$ composer require "twig/twig:3.29.0" --no-update
./composer.json has been updated

$ composer update twig/twig
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
 - Downgrading twig/twig (v3.30.0 => v3.29.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
 - Downgrading twig/twig (v3.30.0 => v3.29.0): Extracting archive
Generating autoload files
51 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.

$ ./vendor/bin/drush cr
[success] Cache rebuild complete.

Et hop, ça remarche ! Plus d'infos sur le problème.

Qq commandes utiles

composer self-update
composer audit

Liens Composer

  • le site officiel : getcomposer.org

CC BY-SA 2026 Patrice Bridoux - Certains droits réservés

Mentions légales & remerciements