HMR does not work for css / js files in Storybook

Created on 16 August 2023, over 1 year ago
Updated 15 November 2023, about 1 year ago

Problem/Motivation

Starting from the Storybook 7.2.3 editing a css or js file changes are not applied to the component markup. Though being properly loaded into SB with the new version of the file. You can notice the SB flashes after saving an asset file of the SDC component so it's not an issue of the SB. Playing with the component SB controls again refreshes the markup but still applies the old version of an asset file. Just full reloading of the SB page or flushing all Drupal caches reveals css / js changes in the SB.

Steps to reproduce

Entirely disable Drupal cache, start your SB and try editing a SDC css or js file.

Proposed resolution

Refresh the query string appended to URL of the Drupal asset files. See string after the question mark:
/core/assets/vendor/normalize-css/normalize.css?rzgyc7
It might be done after the cache killer triggered in the file below:
https://git.drupalcode.org/project/cl_server/-/blob/2.x/src/Controller/S...

Remaining tasks

?

User interface changes

?

API changes

?

Data model changes

?

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇪🇪Estonia drugan

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

Comments & Activities

Production build 0.71.5 2024