bokuweb/re-bulma

Using server side rendering, "document is not defined" error

dokenzy opened this issue · 1 comments

In my server side rendering app, I have come across this error:

project/node_modules/insert-css/index.js:7
    var elem = document.createElement('style');

I just wrote: import { Container } from 're-bulma';

How can I use re-bulma with SSR?

@dokenzy Sorry for my late reply. I think, It is necessary to not insert styles when SSR.

fix this line

insertCss(css, { prepend: true });

if (document) insertCss(css, { prepend: true });