Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issue when updating symfony/asset-mapper recipe #1271

Closed
javiereguiluz opened this issue Dec 15, 2023 · 3 comments
Closed

Issue when updating symfony/asset-mapper recipe #1271

javiereguiluz opened this issue Dec 15, 2023 · 3 comments

Comments

@javiereguiluz
Copy link
Member

I'm upgrading a project to Symfony 7 and when trying to update the symfony/asset-mapper recipe, I see this error:

The problem is here:

  NOTE:
  The file composerjson was not updated because it doesn't exist in your app.

Instead of composer.json, it's trying to update the composerjson file.

And this is the diff file generated:

diff --git a/composerjson b/composerjson
index 98dd8cb..1029865 100644
--- a/composerjson
+++ b/composerjson
@@ -118,7 +118,8 @@
     "scripts": {
         "auto-scripts": {
             "cache:clear": "symfony-cmd",
-            "assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
+            "assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd",
+            "importmap:install": "symfony-cmd"
         },
         "post-install-cmd": [
             "@auto-scripts"
@fabpot
Copy link
Member

fabpot commented Dec 19, 2023

@weaverryan maybe?

@javiereguiluz
Copy link
Member Author

Let's close this issue. It's such an obvious problem that if other people suffered it, we would have received feedback about it. It was probably a weird temporary issue on my side. Thanks!

@klkvsk
Copy link

klkvsk commented Feb 8, 2024

Found the source of this problem here: https://github.com/symfony/flex/blob/bec213c39511eda66663baa2ee7440c65f89c695/src/Configurator/ComposerScriptsConfigurator.php#L52

        $jsonPath = ltrim(str_replace($recipeUpdate->getRootDir(), '', $json->getPath()), '/\\');

if root dir is ".", then "./composer.json" becomes "composerjson"

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants