reactql / kit

ReactQL starter kit (use the CLI)
https://reactql.org
228 stars 38 forks source link

window is not defined in SSR #141

Closed spicerm closed 6 years ago

spicerm commented 6 years ago

Just importing aws-appsync causes this error in SSR, one of the module it depends on uses window somewhere which causes this error.

leebenson commented 6 years ago

This is a common Node problem; it's not an issue with ReactQL, per se. There's simply no concept of window on the server.

To work around it: https://reactql.org/docs/ssr/environment#the-server-constant