inveniosoftware / invenio-app-rdm

Turn-key research data management platform.
https://inveniordm.docs.cern.ch
MIT License
100 stars 144 forks source link

`invenio-cli assets watch` not compiling LESS files on repeated changes #2557

Open daglueck opened 8 months ago

daglueck commented 8 months ago

Package version (if known): 12.0.0b2.dev66 Python version: 3.9.18 Node version: 16.20.2 NPM version: 7.24.2 invenio-cli version: 1.2.0

Describe the bug

When changing a LESS file (hosted within the assets/less directory) and saving it, invenio-cli assets watch recompiles the LESS assets. However, when doing this repeatedly, it seems to recompile effectively only on first change, not on subsequent changes. Although subsequent changes also trigger a recompilation according to terminal output, they don't seem to come into effect; interestingly, the duration of compilations on subsequent changes is also very short in comparison to the first change's compilation.

Steps to Reproduce

I'm taking zenodo-rdm as a public repository for reproducing the error, but it also appeared in a private InvenioRDM instance.

  1. Checkout zenodo-rdm and install and run it according to the instructions.
  2. In a new terminal, run invenio-cli assets watch.
  3. Change a LESS rule, e.g. increase the minimum height of the navbar to 400px and save the file. This will succesfully recompile and the change can be seen on the instance's frontpage (https://127.0.0.1/).
  4. Now change the same LESS rule, e.g. increase the height to 800px, and save the file again. Terminal output says something like webpack ... compiled successfully in ... ms, but when reloading the page, the changes haven't come into effect. Also notice the much shorter compilation time than in step 3.

Expected behavior

invenio-cli assets watch should recompile repeatedly when changing a file multiple times, not just upon first change.

Additional context

This issue also has been discussed on Discord and it seems to apply to multiple of the later invenio-app-rdm v12 beta versions. I'm not sure if it only applies to LESS or also to other types of assets, I've only tested it with LESS files.

github-actions[bot] commented 6 months ago

This issue was automatically marked as stale.

github-actions[bot] commented 4 months ago

This issue was automatically marked as stale.

github-actions[bot] commented 2 months ago

This issue was automatically marked as stale.

github-actions[bot] commented 3 weeks ago

This issue was automatically marked as stale.

dfdan commented 1 week ago

Just to share a workaround that was given to me - if you : touch ${VIRTUAL_ENV}/lib/python3.10/site-packages/invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/theme.less With assets watch still running, it will trigger the webpack rebuild - while you do still have to intervene, this is a lot quicker than restarting the assets watch process.

You may need to correct python3.10 in the path to whatever version you are using.