Remove VERSION from libraries.yml

Created on 8 December 2022, over 1 year ago
Updated 9 December 2023, 7 months ago

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. I discovered this issue when some functionality stopped working after 2.6 -> 2.8 update of the module. The issues were already reported here πŸ› entity_browser 2.9 has JS issue with general user Active .

After some debugging, I found that the issues are fixed after I made sure the browser cache is cleared and the latest assets are loaded.

There could be other reported issues related to this.

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.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Core API

Created by

πŸ‡§πŸ‡ͺBelgium keszthelyi Brussels

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024