2

I have a problem where all of the CSS (style tags) output in my React app are duplicated. The picture below shows an example of the duplication. I have included a copy of my webpack.config.js file here: https://paste.ubuntu.com/p/mdv5Z9bB9v/. I have no idea what's causing this and would love some suggestions for ways to debug this.

Please let me know if any other info is needed!

enter image description here

3
  • Can you show the js file for the element this css applies to? Commented Mar 9, 2020 at 14:30
  • 100% of the site's CSS is duplicated, but here is one of the components (the only place which uses the h2.welcome that you see above): paste.ubuntu.com/p/4x757by67H Commented Mar 9, 2020 at 14:50
  • Yes, I am sure that I am not importing the file twice. Commented Mar 9, 2020 at 15:01

1 Answer 1

1

The problem was that I was importing the bundle.js file in the HTML, although it is added automatically by the webpack, therefore all of the components were being imported twice and hence the CSS was duplicated.

This solution came from here: https://github.com/webpack-contrib/style-loader/issues/143

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.