enovatedesign / craft-style-inliner

A Twig tag for inlining styles in a template
MIT License
7 stars 4 forks source link

Can't update to craftcms/cms 3.7.33, dependency issue with enshrined/svg-sanitize #11

Closed benoitblancquaert closed 2 years ago

benoitblancquaert commented 2 years ago

Update craftcms/cms to 3.7.33 using composer require craftcms/cms:3.7.33 -W returns a dependency error:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Root composer.json requires craftcms/cms 3.7.33 -> satisfiable by craftcms/cms[3.7.33].
    - enovatedesign/craft-style-inliner 2.2.0 requires enshrined/svg-sanitize ^0.14 -> satisfiable by enshrined/svg-sanitize[0.14.0, 0.14.1].
    - You can only install one version of a package, so only one of these can be installed: enshrined/svg-sanitize[0.14.0, 0.14.1, 0.15.2, 0.15.3].
    - craftcms/cms 3.7.33 requires enshrined/svg-sanitize ~0.15.2 -> satisfiable by enshrined/svg-sanitize[0.15.2, 0.15.3].
    - Root composer.json requires enovatedesign/craft-style-inliner 2.2.0 -> satisfiable by enovatedesign/craft-style-inliner[2.2.0].

composer install locks enshrined/svg-sanitize to 0.14.1:

Locking enshrined/svg-sanitize (0.14.1)

The plugin enovatedesign/craft-style-inliner is blocking the update of craftcms/cms to 3.7.33 because it requires version 0.15 of svg-sanitizer. Could this dependency be updated?

romainpoirier commented 2 years ago

I get the same problem:

./craft update/update all
Fetching available updates ... done
Performing 4 updates:

    - craft 3.7.32 => 3.7.34
    - minify 1.2.10 => 1.2.11
    - redactor 2.10.3 => 2.10.4
    - typogrify 1.1.18 => 1.1.19

Create database backup? (yes|no) [yes]:no
Skipping database backup.
Performing update with Composer ... error: An error occurred

Output:

Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install craftcms/cms 3.7.34 (conflict analysis result)
    - Conclusion: don't install enshrined/svg-sanitize 0.15.4 (conflict analysis result)
    - Root composer.json requires craftcms/cms 3.7.34 -> satisfiable by craftcms/cms[3.7.34].
    - Conclusion: don't install enshrined/svg-sanitize 0.15.3 (conflict analysis result)
    - Conclusion: don't install enshrined/svg-sanitize 0.14.1 (conflict analysis result)
    - enovatedesign/craft-style-inliner is locked to version 2.3.0 and an update of this package was not requested.
    - craftcms/cms 3.7.34 requires enshrined/svg-sanitize ~0.15.2 -> satisfiable by enshrined/svg-sanitize[0.15.2, 0.15.3, 0.15.4].
    - You can only install one version of a package, so only one of these can be installed: enshrined/svg-sanitize[0.14.0, ..., 0.15.4].
    - enovatedesign/craft-style-inliner 2.3.0 requires enshrined/svg-sanitize ^0.14 -> satisfiable by enshrined/svg-sanitize[0.14.0, 0.14.1].
    - Conclusion: don't install enshrined/svg-sanitize 0.14.0 (conflict analysis result)

<warning>Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.</warning>
mtwalsh commented 2 years ago

@benoitblancquaert @romainpoirier Thanks for reporting this, we have pushed an update. Please can you give that a try and let us know if it resolves the issue for you?

romainpoirier commented 2 years ago

I don't see plugin update, is that from a new version? I can confirm that I still can't run ./craft update/update all and I still get the same error.

jurdunnn commented 2 years ago

@romainpoirier I've updated the release, give this another try.

romainpoirier commented 2 years ago

Thank you, I still don't see the update on ./craft update/update all but I can add it manually on composer.json.

The problem is that I got this:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires enovatedesign/craft-style-inliner 2.4.0 -> satisfiable by enovatedesign/craft-style-inliner[2.4.0].
    - enovatedesign/craft-style-inliner 2.4.0 requires craftcms/cms ^3.7.33 -> found craftcms/cms[3.7.33, 3.7.34] but it conflicts with your root composer.json require (3.7.32).

I know I could first update craftcms/cms before enovatedesign/craft-style-inliner but I can't, I still get the error:

  Problem 1
    - Root composer.json requires craftcms/cms 3.7.33 -> satisfiable by craftcms/cms[3.7.33].
    - Conclusion: don't install enshrined/svg-sanitize 0.15.4 (conflict analysis result)
    - Root composer.json requires enovatedesign/craft-style-inliner 2.3.0 -> satisfiable by enovatedesign/craft-style-inliner[2.3.0].
    - craftcms/cms 3.7.33 requires enshrined/svg-sanitize ~0.15.2 -> satisfiable by enshrined/svg-sanitize[0.15.2, 0.15.3, 0.15.4].
    - You can only install one version of a package, so only one of these can be installed: enshrined/svg-sanitize[0.14.0, ..., 0.15.4].
    - enovatedesign/craft-style-inliner 2.3.0 requires enshrined/svg-sanitize ^0.14 -> satisfiable by enshrined/svg-sanitize[0.14.0, 0.14.1].
    - Conclusion: don't install enshrined/svg-sanitize 0.14.1 (conflict analysis result)

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

So the only way I have is to uninstall the plugin, then update Craft, then re-install the plugin (which works but in a very inconvenient way because of my deployments processes).

benoitblancquaert commented 2 years ago

So the only way I have is to uninstall the plugin, then update Craft, then re-install the plugin (which works but in a very inconvenient way because of my deployments processes).

That's what I was thinking too and it doesn't seem right to me.

jurdunnn commented 2 years ago

It may be worth trying manually specifying the versions in composer.json and then running composer update.

-     "enovatedesign/craft-style-inliner": “2.3.0”,
-     "enshrined/svg-sanitize": "^0.14”,
+    "enovatedesign/craft-style-inliner": "2.4.0",
+    "enshrined/svg-sanitize": "^0.15.2”,
-     "craftcms/cms": “3.6.12.1",
+     "craftcms/cms": "3.7.33",

composer update

romainpoirier commented 2 years ago

I still can't update from craft 3.7.32 to3.7.37 because of this error. This is very annoying to have to uninstall the plugin and then install it again in a deploy workflow.

I tried to add enshrined/svg-sanitize to composer.jsonusing versions 0.15.2, ^0.14 and ^0.15.2 but always got this kind of error:

% ./craft update/update all
Updates are disallowed for this environment. Update anyway? (yes|no) [no]:yes
Fetching available updates ... done
Performing one update:

    - craft 3.7.32 => 3.7.37

Create database backup? (yes|no) [yes]:no
Skipping database backup.
Performing update with Composer ... error: An error occurred

Output:

Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - enovatedesign/craft-style-inliner is locked to version 2.3.0 and an update of this package was not requested.
    - enovatedesign/craft-style-inliner 2.3.0 requires enshrined/svg-sanitize ^0.14 -> found enshrined/svg-sanitize[0.14.0, 0.14.1] but it conflicts with your root composer.json require (0.15.2).

<warning>Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.</warning>

Any update on this?

mtwalsh commented 2 years ago

@romainpoirier Have you tried running the update with Composer directly rather than using the ./craft ... command?

Also, are you able to share your composer.json file? As it looks like perhaps you have the version of this plugin locked.

For Craft 3 it should be:

"enovatedesign/craft-style-inliner": "^2.0",

And for Craft 4:

"enovatedesign/craft-style-inliner": "^3.0",

I hope that helps.

romainpoirier commented 2 years ago

Yes of course I have tried both composer update & composer install after the ./craft update/update. This is a Craft 3 website.

Today I tried this:

  1. Change "enovatedesign/craft-style-inliner": "2.4.0" to "enovatedesign/craft-style-inliner": "^2.0" in the composer.json file
  2. Change "craftcms/cms": "3.7.41" to "craftcms/cms": "3.7.43"
  3. Run composer update

This time, that works! I don't know if it's the new craftcms/cms version that fix this, or if it was the craft-style-inliner version declared to 2.4.0. But for now that works, thank you!

I just have to be very careful later, because I prefer to mention a strict version (2.4.0 instead of ^2.0) to prevent update / project-config issues on deployments if there's a new release that I have still updated.

mtwalsh commented 2 years ago

Ah, glad to hear your issue is now resolved.

For what it's worth, providing you commit your composer.lock file, and on deployment you are just running a composer install that should never result in an update of a dependency on deployment. It will just install the exact versions that have been captured in the composer.lock file so it should be safe to use ^2.0 in the composer.json file. But of course I know nothing about how you are deploying your projects so that might not suit.