-
Notifications
You must be signed in to change notification settings - Fork 254
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
Next.js 12 and React 18 getCSSText
not rendering styles SSR
#863
Comments
Have you tried to add
|
Yes. I meant to edit my code snippet. Has no impact. |
Streaming SSR w/ React 18 is a major change for dynamic CSS-in-JS libs and unsupported at the moment. There's a thread here from the React team on what CSS-in-JS libs need to do to support React 18 SSR, good reading material: At the moment, we're reviewing this info and deciding on the best path towards support. |
This is a really great resource. Thank you for sharing. Looking forward to what you come up with. |
Right now i am thinking of moving a large code of Less to Stiches but i am cautios if you guys are going to support this streaming SSR w react 18, is that planned or expected to be working on future? |
@b2rsp hi, yeah, we're considering it but would require some strategic changes - static extraction |
@peduarte Thanks for feedback, either way we started migrating our system from less into stiches and so far realy enjoying it. Just looking foward to see about to see the streaming server SSR since that will be really good for page load perceived performance. |
Any news on Stiches with React 18 :) ? |
Bug report
Describe the bug
After creating a Next.js 12 application with React 18 and a basic Stitches config, the
getCSSText
function does not collect styles from the page during SSR, which causes a FOUC.To Reproduce
Steps to reproduce the behavior:
package.json
next.config.js
tsconfig.json
stitches.config.ts
pages/_document.tsx
pages/_app.tsx
pages/index.tsx
Expected behavior
I would expect that the SSR rendered page would have collected the styles from the given page so there is no FOUC, however, there are no matching css declarations when viewing the source of the page.
Screenshots
Here you can see that there is no matching rule for this className. I've simply set the background color for this element.
Here is the page source when downgrading Next to 11.1.2. You'll notice that the CSS is rendered properly on the server
System information
The text was updated successfully, but these errors were encountered: