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.

Multiple style tags with linaria

See original GitHub issue

Bug 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.

  1. Go to with-linaria example. (However this will be happening for all .css users)
  2. Create a bunch of pages with styled components created in them from linaria.
  3. Link to them from homepage.
  4. 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

https://imgur.com/a/00vJfag

System information

Irrelevant.

Additional context

https://github.com/zeit/next.js/issues/9931

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Timercommented, Feb 7, 2020

This should be fixed in the latest next@canary.

0reactions
balazsorban44commented, Jan 30, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Linaria for faster CSS-in-JS in React apps
Prop-based styles. The styled tag support dynamic styling where we style components based on their props. The code below renders styled ...
Read more >
Zero-runtime CSS from JS with Linaria | blog {callstack}
Linaria is a library which allows you to write CSS inside your ... You can also compose multiple styles together with the include...
Read more >
How to use more than one style attribute in HTML [duplicate]
INLINE STYLES. You put CSS right into HTML element. Multiple CSS attributes are divided by semicolon ; e.g. <p style="color:red; margin: 0;">.
Read more >
CSS-in-JS for React: Linaria vs. Styled Components
These considerations have driven many to choose CSS-in-JS ... import { css } from '@linaria/core'; // Write your styles in `css` tag const ......
Read more >
Styling - Remix
Remix supports many of them out of the box, but the frameworks that require ... prefer your stylesheets had a URL instead of...
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