Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Upgrade asset mapper to 6.4 fails due to invalid entry "downloaded_to" #52810

Closed
@redflo

Description

@redflo

Symfony version(s) affected

6.4.0

Description

My project uses the asset mapper and as here described:
https://symfony.com/doc/current/frontend/asset_mapper.html#importing-3rd-party-javascript-packages
i downloaded bootstrap with the --download option (which is not working either in 6.4. - documentation issue too).
This generates
'downloaded_to' => 'vendor/....'
Entries in importmap.php which then cause a exception when calling {{ importmap() }} in twig or when trying to update importmaps.
Deleting these downloaded_to fixes the problem after running
bin/console importmap:update

How to reproduce

Install symfony 6.3, add assetmapper, run
php bin/console importmap:require bootstrap --download
Upgrade to symfony 6.4 (including recipes updates)
run bin/console importmap:update
It gives a error:
`In ImportMapConfigReader.php line 46:

The following keys are not valid for the importmap entry "bootstrap": "downloaded_to". Valid keys are: "path", "version", "type", "entrypoint", "url", "package_specifier".
`

Possible Solution

flex recipes should sanatize importmap.php or the importmap:update should handle the upgrade situation

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions