Skip to content
This repository has been archived by the owner on Aug 5, 2019. It is now read-only.

ReferenceError: document is not defined #61

Closed
albert-olive opened this issue Aug 4, 2017 · 3 comments
Closed

ReferenceError: document is not defined #61

albert-olive opened this issue Aug 4, 2017 · 3 comments

Comments

@albert-olive
Copy link

albert-olive commented Aug 4, 2017

Hi,

When upgrading to 3.0.0-0 I'm having this error:

node_modules/reflexbox/dist/sheet.js:7
var style = document.createElement('style');
                     ^

ReferenceError: document is not defined
    at Object.<anonymous> (/Users/Repos/web/node_modules/reflexbox/dist/sheet.js:7:22)
    at Module._compile (module.js:570:32)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/Repos/web/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Function.cls_wrapMethod [as _load] (/Users/Repos/web/node_modules/newrelic/lib/shimmer.js:256:38)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

Anybody have this too?

[EDIT] - v2.2.2 works fine.

Thanks

@jxnblk
Copy link
Owner

jxnblk commented Aug 4, 2017

v3 is a rewrite and doesn't currently work in SSR, see https://github.com/jxnblk/reflexbox#caveats

v2 will continue to work, but if you want something that uses css-in-js, maybe consider https://github.com/jxnblk/grid-styled

@albert-olive
Copy link
Author

Ok, thank you for your response. We use SSR and that's why. We'll look something else.

@jcollum
Copy link

jcollum commented Mar 19, 2018

Could you clarify that caveat? I'm unclear what you mean by server-side applications since this is a React library.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants