Stale styles: Multiple <style>
are injected on <head>
on save, for the same component - Monorepo structure
#1305
Labels
bug report 🦗
Issue is probably a bug, but it needs to be checked
cat: monorepo 🔱
Issues related to usage of linaria in monorepo
needs: complete repro 🖥️
Issue need to have complete repro provided
Environment
This particular case is happening in a Monorepo configure with
rush
Description
Best way to describe this is to check the video below.
Quick TLDR:
When changing styles on a component, the
<head>
element is injected with multiple<style>
elements for the same component. Previous styles for the same component don't seem to be cleared.This makes it look like the page doesn't react to style changes on save.
A hard refresh (refresh the browser manually) clears all old styles and the page looks good.
This only happens when we change to previously used styles
Example
font-size
is in the beginning3rem
font-size
to4rem
font-size
to3rem
(previous value)<style>
elements for the same componentThe "Dotted" styled component in the "App.tsx" file updates fine if we change its values.
Reproducible Demo
I created a minimal reproducible repository:
https://github.com/JoaoFGuiomar/minimal-repo
Instructions are on the README. Will also drop a quick video below
Bug.Video.mov
Thanks 👍
The text was updated successfully, but these errors were encountered: