react-button 0.14.0 broken in SSR due to window usage
renanbatel opened this issue · comments
Renan Batel commented
Just got the new version (0.14.0) of react-button and I see that window
is being used on the .js dist file. So I can't use it on my server rendered react app (next.js), 0.13.0 works fine.
James Daly commented
I have the same issue using react-card - also downgrading to 0.13.0 works fine for me as well.
Matt Goo commented
Thanks for opening the issue. I'll look into fixing this.
Looks like this is related to the webpack update.
EDIT: Looks like in v0.13.0 typeof self !== 'undefined' ? self : this
has been replaced with window
. I believe this is defined by the output.globalObject
property in the configuration, which has a default to window
. Remediation is to set
output.globalObject: `typeof self !== 'undefined' ? self : this`
Matt Goo commented
please try v0.14.1