You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
inline <style> tags get removed by <Suspense> streaming, making styles disappear #5808
In my Nextjs project with cacheComponents, I have a reading the searchParams to see if it needs to set pre-selected search options in my search engine. The fallback I give it, is the search options components without any selections, and when searchParams are read, the correct selections are set. So I move from a "skeleton" (the fully rendered engine, without selection) to the "real" populated component.
Since the component is rendered in fallback at first, it receives <style> tags for components that are unique to that component. When the final populated comes in, the component is replaced by Next. Since SC is no longer doing its magic at this point, the <style> tag is not included here. It gets removed. Thus my styling disappears.
Schermopname.2026-09-03.om.14.27.01.mov
Also #5728 is still a bug with the inline <style> tags. Although its hard to reproduce the setup where streaming is that obvious.
Activity
pullfrog commentedon Sep 3, 2026
quantizor commentedon Sep 5, 2026
Thank you for reporting! Please give this build a try when you get a moment: https://github.com/styled-components/styled-components/releases/tag/styled-components%406.6.0-prerelease-20260905051044
laurenskling commentedon Sep 6, 2026
Sadly still happens
fix: emit RSC styles per instance so they survive Suspense reveals (#…
quantizor commentedon Sep 8, 2026
Thanks again for the clear report and video @laurenskling. This should be fixed on the latest 6.x prerelease:
(or
[email protected]). When you get a chance, could you retest and confirm the styles hold through the Suspense reveal? https://www.npmjs.com/package/styled-components/v/6.6.0-prerelease-20260908162735laurenskling commentedon Sep 17, 2026
It works! Thank you
laurenskling commentedon Sep 18, 2026
I guess this is related; looping over a SC makes the style be rendered for ever cycle:
6.x maintenance: attrs and undefined props, RSC global styles, types …
quantizor commentedon Oct 12, 2026
Made some additional improvements, but some amount of duplication cannot be helped in this scenario. Final implementation now out in 6.6, thanks! https://github.com/styled-components/styled-components/releases/tag/styled-components%406.6.0
quantizor commentedon Nov 25, 2026
Fixed in 6.7