Does not install (Composer lies)

Created on 15 November 2024, 8 days ago

Problem/Motivation

I did not want to create this issue because everything looks like it has been done the way it should. I am trying to get to the latest version of Drupal 9, so I can upgrade to Drupal 10. For some mysterious reason, composer is resolving this module to the beta1 release (backwards from rc1 which was the last version installed), which does not work. The only place I am requiring this module is in the root composer.json of my project, where I have set

"minimum-stability": "dev",
"prefer-stable": true,

Okay so that's strange, but then I try to upgrade to the latest RC release: https://www.drupal.org/project/custom_book_block/releases/1.0.0-rc2 β†’
or straight to 1.0.x-dev

Now is when I learn what composer is really thinking:

...
- drupal/custom_book_block dev-1.0.x requires drupal/book * -> satisfiable by drupal/book[dev-1.0.x, dev-2.0.x, 1.0.0, 1.0.x-dev, 2.0.0-alpha1, ..., 2.0.x-dev], drupal/core[8.0.0-beta8, ..., 8.9.x-dev, 9.0.0-alpha1, ...,9.4.3, 10.0.0-alpha1, ..., 10.0.0-alpha6].
- drupal/book[dev-1.0.x, 1.0.0, ..., 1.0.x-dev] require drupal/core >=10.0 -> satisfiable by drupal/core[10.0.0-alpha1, ..., 10.5.x-dev, 11.0.0-alpha1, ..., 11.x-dev].
- drupal/book[dev-2.0.x, 2.0.0-alpha1, ..., 2.0.x-dev] require drupal/core ^10.3 || ^11 -> satisfiable by drupal/core[10.3.0-beta1, ..., 10.5.x-dev, 11.0.0-alpha1, ..., 11.x-dev].
...

Now I looked in the 1.0.x-dev composer.json, and it most certainly does not require the contrib book module, and same for the RC release. I am really not sure why composer thinks this. I tried deleting my lock file. I tried deleting all of vendor, core, and contrib. There is something I am not seeing.

I checked composer why:

ddev composer why drupal/custom_book_block
my_project/my_project dev-main requires drupal/custom_book_block (^1)

Proposed resolution

This is not a permanent resolution. But I got around this issue by creating a patch that was a diff between the 1.0.x branch and the beta1 branch, and just applying it. Everything seems happy. I thought I would document this in case anyone else comes across this strange issue. And perhaps there is a better solution that I am just not seeing.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @MegaKeegMan
  • πŸ‡©πŸ‡ͺGermany simonbaese Berlin

    The version 1.0.x depends on the Drupal core book module. The core module has been deprecated in Drupal 10.3, please see The Book module is deprecated β†’ . We tagged version 1.1.x to depend on the new contrib book module. You may run into conflicts because we also increased the minimum Drupal core version requirements before tagging a stable release of this module.

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    Right, but I am constraining to 1.0.x still, not 1.1.x. So it doesn't make sense to me that composer is unhappy, since it should be cool with Drupal 8, 9, or 10, and I am running into this error while my Drupal Core constraint is set to 9.5.11

  • πŸ‡©πŸ‡ͺGermany simonbaese Berlin

    Not sure why this is happening. The 1.0.x branch does not have a composer dependency on drupal/book. Maybe you can require version 1.0.0-rc1 before the module had a composer.json file.

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    I thought the same thing and unfortunately I get the same problem. It feels like composer is just looking at the wrong thing for some reason. When I have a minute, I can try this out on a fresh install and see if I get the same thing.

  • πŸ‡©πŸ‡ͺGermany simonbaese Berlin

    Only other thing I can think of is composer clear-cache.

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    I tried that too :(

Production build 0.71.5 2024