strues / react-universal-boiler

A bold way to begin your next great universal React application. Uses Webpack 3, React 16, Redux, and more for a great developer experience.
MIT License
65 stars 11 forks source link

Styled components css Is not generated on the server #28

Closed ilanus closed 7 years ago

ilanus commented 7 years ago

It seems that after recent changes, the server does not compile styled-components chunks the className is there but css is empty. and there's an error from the console Warning: Failed context type: Invalid contextstyled-components-stylesheetof typeStyleSheetsupplied toComponent, expected instance ofStyleSheet. If Javascript is turned on everything is works fine, any idea what's missing?

ilanus commented 7 years ago

@strues It appears that renderToNodeStream returns the initial SSR render before all styled-components style is collected. I'm not sure what is a good solution around it?

strues commented 7 years ago

Fixing this right now.

strues commented 7 years ago

Fixed e0bd16720e128b41fb349e0b3046ee2f01abc90d

ilanus commented 7 years ago

Looks great! that's what I had in mind, do you think that using both renderToString, renderToNodeStream is fine in terms of performance?