Closed oyeanuj closed 5 years ago
Hey @oyeanuj!
Hmm interesting as the component doesn't seem to use window
anywhere except for within the frame. This might need some further exploration.
I currently don't have time to contribute to the component but as mentioned in the other issue: if you'd like to use this feel free to contribute, I'm happy to answer any questions you may have. 🙂
Thanks for the quick response! I think the window
object might be used by the Intercom API itself. The react-intercom
component has a check to see if DOM can be used before proceeding further:
I feel like in their case the check is mainly there because they're directly referencing window.Intercom
whereas we wait until the iframe has been loaded. I might be wrong though and I wonder where the window
reference that is throwing the error in our case lives.
Update: the library doesn't reference window
anywhere directly, therefor I'm not sure this is caused by the library. I'll close the issue for now, if more SSR issues pop up we can reopen it.
Hi @kvendrik! As I was playing with this, I am seeing errors on the server side since the
window
object is not available on the server:I assume a check is needed to see if the
window
object is defined and if not, aborting early?