reactackle
reactackle copied to clipboard
ReferenceError: window is not defined
This error occur on SSR
[1] /app/node_modules/reactackle-autoposition/dist/AutoPosition.js:125
[1] parent: window,
[1] ^
[1]
[1] ReferenceError: window is not defined
[1] at Object.<anonymous> (/app/node_modules/reactackle-autoposition/dist/AutoPosition.js:125:11)
[1] at Module._compile (module.js:624:30)
[1] at Object.Module._extensions..js (module.js:635:10)
[1] at Module.load (module.js:545:32)
[1] at tryModuleLoad (module.js:508:12)
[1] at Function.Module._load (module.js:500:3)
[1] at Module.require (module.js:568:17)
[1] at require (internal/module.js:11:18)
[1] at Object.<anonymous> (/app/node_modules/reactackle-autoposition/dist/index.js:8:21)
[1] at Module._compile (module.js:624:30)
@gsoec Currently, Reactackle is not adapted for SSR rendering. Here is the workaround:
let AutoPosition;
if (typeof window !== "undefined") {
SelectBox = require("reactackle-selectbox").SelectBox;
}
#100
@gsoec You are welcome to contribute in https://github.com/bcrumbs/reactackle/issues/100. SSR is important thing, but we just haven't enough time for it now.