React CSS is duplicated

Viewed 1061

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

1 Answers

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

Related