title: Next JS with styled components component library
body: <p>Im trying to get next js to load properly with a transpiled styled components component library. Here is a simple repo for reproducing the problem: <a href="https://github.com/vongohren/fouc-example" rel="nofollow noreferrer">https://github.com/vongohren/fouc-example</a></p>
  
  <p>So what happens is that I have a small app that renders the components, but it does not showcase the style on the SSR request, only when the client has been loaded.</p>
  
  <p>Im trying all cases where I do the loading inside the document: <a href="https://github.com/zeit/next.js/blob/canary/examples/with-styled-components/pages/_document.js" rel="nofollow noreferrer">https://github.com/zeit/next.js/blob/canary/examples/with-styled-components/pages/_document.js</a></p>
  
  <p>But it is not able to catch the css from the components. Only the components built in the SSR function itself, and not the components I import.</p>
  
  <p>How can I debug this and figure out how the CSS can be attached on the SSR request as well, and not just the loading of the JS.</p>
  
  <p>I was able to get something to work when using <a href="https://github.com/callstack/linaria" rel="nofollow noreferrer">https://github.com/callstack/linaria</a> in the components library, because that outputs a CSS file, I was able to import and add to the SSR rendering. But how can I approach this with styled-components?</p>