question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Styles are getting duplicated on file change

See original GitHub issue

Here’s an example https://stackblitz.com/edit/angular-v7k3u9

Change a file (any file, even a component typescript file) and notice that a new <style> tag is inserted every time.

Another issue that might be related is that if you make an error in the styles.scss file like for example misspelling !important like !importan it will forever error, even if you fix it. You must reload the entire page to resolve this issue. It’s remembering when it was wrong and still trying to compile it. This also happens when editing a component’s scss, not just the main styles.scss. Changing the reload mechanism to “save” doesn’t even help. The errors show up on edit so I have to reload all the time, it’s quite unbearable.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
apai4commented, Oct 4, 2018

@tylde Sorry for the delay, I just pushed a fix for this so styles in React should be unloading properly now 😃 Lmk if you’re still running into problems with this

0reactions
tyldecommented, Oct 4, 2018

It works fine now, thanks. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styles duplicated across css chunks create source order ...
When I build the project that component's styles are duplicated in each of the relevant css page chunks; this creates visual bugs.
Read more >
styles that are used are duplicated (eg. pink becomes pink2)
When I copy cells from one xlsx file to another, the styles are duplicated. - So, there used to be "pink" style, but...
Read more >
Duplicate Graphic Styles when copying form one dokument ...
When I copy objects that are linked to graphic style from one document and paste them into a document with the identical graphic...
Read more >
Duplicated styles on head and a lot of <style> elements
The behavior you're seeing is caused by ViewEncapsulation.Emulated defined for material components. First, you don't need to add styles for ...
Read more >
Why are Angular Material styles duplicated in my project?
Instructions for troubleshooting duplication of styles caused by theming configuration.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found