-
Notifications
You must be signed in to change notification settings - Fork 17
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
SSR of CSS not working > Can not prevent FOUC (NextJS) #29
Comments
Thanks for the report. I try to take a look next week. Would it be possible for you to upgrade to v1 (the next branch in the twind repo)? I believe that this issue is fixed there. |
Hi @sastan! Thanks so much for getting back to me. So I tried to upgrade to When I try to Unfortunately, when trying to I've paired with my CTO on this to see if we could resolve this but the errors don't really make sense. Tried uninstalled/reinstalled Currently, |
That is my bad. Sorry. For v1 you should use @twind/with-next. There is an example linked in the readme. I'm very sorry for the lack of documentation. |
Ahhh I see, I missed the |
Hi there, Just an update. In the end, it was a huge overhaul to try and upgrade our entire environment and codebase to get this working. We managed to isolate the issue to Although this issue ultimately wasn't solved, feel free to close. |
Hi there!
I really love what you're doing with Twind. I've been implementing it in our codebase and got really far, but ultimately got blocked on an SSR issue and am unable to move forward.
We're seeing a FOUC on the pages because the CSS isn't getting rendered on server-side, and the styles only come in later on client-side.
In the building stage, we're seeing the
LATE_SETUP_CALL
notices and have not been able to resolve them. Looked through this open issue, but didn't seem to have a solution.In the Twind Next JS Code Sandbox example, the styles are also missing from the head as well. It shows as an empty style tag:
<style id="__tw-9"></style>
without styles. We're seeing the same thing our end as well. This suggests that React is correctly creating the style element and setting theid: '__' + hash
but not inserting any styles within or getting thetextContent
.In the Sandbox example, there is a
data-next-hide-fouc="true"
but we don't want the page empty before the styles come in. We're assuming that SSR should work out of the box with the Twind integration, but is there something we've missed in the documentation that says otherwise? Bit of a loss as to what to do next, so any direction would be greatly appreciated!Running on:
twind.config.js
pages/_app.js
pages/_document.tsx
next.config.js
Thanks in advance!
The text was updated successfully, but these errors were encountered: