Copied this wonderful summary from #3325948: Remove VERSION from libraries.yml - huge thanks to the author @keszthelyi:

Problem/Motivation

The version: VERSION lines in libraries.yml are creating a version query string using the Drupal Core version number for the asset files, making these files cached in the browser dependent on the Core version.

Steps to reproduce

This can produce various problems after an update, as the old versions of assets might be loaded for users who have those cached.

Proposed resolution

Remove the version: VERSION lines from libraries.yml.

By doing this, Drupal will use an automatically generated query string added to filenames. From the code documentation:

The string changes on every update or full cache flush, forcing browsers to load a new copy of the files as the URL changed.

See: web/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php:62

The other option is to explicitly set the module's version on these lines and keep track of it when the version number changes/the asset is updated.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anybody created an issue. See original summary.

anybody’s picture

Status: Active » Needs review
eiriksm’s picture

Status: Needs review » Needs work

I think you maybe forgot to push to the branch and create a MR? 😅🤓✌️

anybody’s picture

Status: Needs work » Needs review

lol, sorry @eiriksm indeed. I did this in all affected projects we use and seem to have missed things here.

anybody’s picture

Interesting, the failing tests look unrelated?

eiriksm’s picture

Status: Needs review » Reviewed & tested by the community

absolutely

  • anybody committed 0f062280 on 2.1.x
    feat: #3580971 Remove VERSION from libraries.yml
eiriksm’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

eiriksm’s picture

Can you open separate issues for the failures maybe? Looks pretty straight forward to fix :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.