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

Plugin is always preloading and appending to body despite having linkstyles already in HTML #306

Open
KevinGruber opened this issue Dec 22, 2020 · 6 comments

Comments

@KevinGruber
Copy link

Hi,

I am using the newest version of the Plugin + Webpack4.

Since the preload feature was added, it always adds the style tags to the body despite having them already in the HTML.
In my opinion it should not add the preload tags if the stylesheets are already added to the HTML.

https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/blob/master/src/index.js#L390

I think it is a bug, as I don't see any reason of adding the same stylesheet twice.

BR,
Kevin

@chinaso2018
Copy link

chinaso2018 commented Jan 11, 2021

I have the same problem。This plugin add A stylesheet before B stylesheet in head element but add B stylesheet before A stylesheet in body

I think it is a criticle bug

By the way , I`m using nuxtjs and extractCSS set true

https://n3.map.pg0.cn/T1ZbZLBvZT1RCvBVdK

@kamilic
Copy link

kamilic commented Jan 19, 2021

It seems to cause bugs when use import('./my-module.js'). (./my-module.js includes some .css requires.)

It v4.7.5, js module will be execute after css child dependencies will be fully loaded.
But in v4.8, it's seems that css child dependencies and js module will be loaded in parallel.

In parent ./my-module.js module, it has some logic like getComputedStyle().
It fails to get correct style.

v4.7.5 -> v4.8 seems cause a breaking changes.

I will try to create a minimal problem reproduction repo like for you to debug.

@t1mwillis
Copy link

👀 #307

@TroAlexis
Copy link

Same problem here. Stylesheet links get appended both to head and body

@sinneren
Copy link

Same issue. Is author support this plugin yet?

@rinotova
Copy link

Fixed in version 4.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants