Multiple style tags with linaria
See original GitHub issueBug report
Since testing upgrade to Next 9.2.0 my lighthouse performance score has lost -30 points, leading to an inability to upgrade the version from 9.1.7.
Describe the bug
On quick investigation this is due to next-css (the plugin i use in combination with Linaria css-in-js). Working in sync with the new inbuilt css changes and adding 20+ <link rel="preload"...> and <link rel="stylesheet" .../> tags into the headers; Iv’e attached screenshots at the bottom.
This leads to the lighthouse warning: “Peyload key requests” Potential sayings “0.6s”
“A preload <link> was found for “https://MYWEBSITEHERE/_next/static/css/bdc370faa38e17f08cb420bf2435de212a3f524f.81ef22a8.chunk.css” but was not used by the browser. Check that you are using the crossorigin attribute properly.”
A clear and concise description of what the bug is.
To Reproduce
Haven’t tested but can imagine its easily reproducible in a couple of small steps.
- Go to with-linaria example. (However this will be happening for all .css users)
- Create a bunch of pages with styled components created in them from linaria.
- Link to them from homepage.
- Deploy application on now with NextJS 9.2.0+
Expected behavior
The expected behavior is that next-css should be unaffected by the inbuilt css changes. However the desired behavior should be linaria operates with the same special permissions as css-modules in terms of allowing css imports in any file (not just _app.tsx).
Screenshots
System information
Irrelevant.
Additional context
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)

Top Related StackOverflow Question
This should be fixed in the latest
next@canary.This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.