Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New compiled CSS is not seen as new by Styleguidist or Jest. #816

Closed
GoOz opened this issue Jan 22, 2019 · 5 comments
Closed

New compiled CSS is not seen as new by Styleguidist or Jest. #816

GoOz opened this issue Jan 22, 2019 · 5 comments

Comments

@GoOz
Copy link
Contributor

GoOz commented Jan 22, 2019

While working locally, any new compilation of CSS due to any change does not:

  • trigger a hot-reload on Styleguidist, it can see the change, says it's compiling but doesn't reload and even if you manually reload CSS stays the same as before, the new css is not compiled or refreshed.
    Workaround: You have to re-launch Styleguidist manually with CLI.
  • Jest keeps the old CSS in cache and never update it, therefore tests fails to be right. Tests fail when they shouldn't and updating tests fail too.
    Workaround: Run a yarn jest --clearCache before running any other jest command.
@GoOz GoOz added the 🐛 bug label Jan 22, 2019
@y-lohse
Copy link
Contributor

y-lohse commented Apr 16, 2019

@y-lohse
Copy link
Contributor

y-lohse commented Jul 12, 2019

After some more exploration of the problem, it seems that:

  • we are displaying transpiled components in the styleguidist (yay)
  • but the stylesheet for the transpiled components is not re-generated when a stylus file changes

Still investigating.

@y-lohse
Copy link
Contributor

y-lohse commented Jul 12, 2019

No luck this time. More notes for next time:

@y-lohse
Copy link
Contributor

y-lohse commented Jul 30, 2020

Some more infos, it seems related to michalkvasnicak/babel-plugin-css-modules-transform#27 and we have the same issue in cozy-sharings for example. It's a known limitation of the plugin we use and it's unlikely to be fixed.

The problem can be mitigated a little by setting devMode to true in the options. With that option, the stylesheet is rebuilt when js files are changed. It still doesn't rebuild it when the stylus files are changed though.

A longer term solution would probably be to change our stylus compilation setup entirely.

@ptbrowne
Copy link
Contributor

ptbrowne commented Mar 4, 2021

I am closing, it's been a long time since we haven't had any report of the issue, please re-open if necessary.

@ptbrowne ptbrowne closed this as completed Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants