Jss: First SSR render has no sheets attached

Created on 30 Jun 2017  路  2Comments  路  Source: cssinjs/jss

Setting up JSS on the server side and I've been noticing that the call to sheets.toString call returns nothing for the first request
image

However on subsequent requests the CSS is available on the server and so content loads perfectly with JS disabled.
image

Has anyone seen anything like this? I would guess this line is the culprit, but I haven't looked into where sheets are .attached.

As an aside, the react-ssr example (found here) isn't really Server-Side rendering (or at least it's such a simple example it's hard to relate to given that it just generates static content). If I have some time I'll toss up a PR to add one where there is a running web server involved.

question

Most helpful comment

We released react-jss 7, check it out.

All 2 comments

It is most probably related to your logic, which does't render stuff on first request. If you can create a simple reproducible example, I can look into it.

We released react-jss 7, check it out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brianmhunt picture brianmhunt  路  5Comments

glowkeeper picture glowkeeper  路  5Comments

oliviertassinari picture oliviertassinari  路  4Comments

AleshaOleg picture AleshaOleg  路  3Comments

kof picture kof  路  4Comments