nhagen / react-intercom

A component to configure and enable Intercom in your react application
MIT License
237 stars 72 forks source link

Uncaught TypeError: window.Intercom is not a function #15

Closed jlejoux closed 8 years ago

jlejoux commented 8 years ago

This happens sometimes when I go back on my application history and then when the component which contains Intercom is updated.

nhagen commented 8 years ago

The only obvious reason I can see for this is there is some reference to the component updating after it has unmounted. I'm not sure what might cause that.

Are you able to reliably reproduce this in your application? If you could put breakpoints in the componentWillRecieveProps and componentWillUnmount and confirm that this is happening, that would narrow it down a little bit.

Maybe a code example would also be useful for helping narrow down if there is an issue with the component. I should get around to adding tests, which should catch things like this (if we know what might cause them).

jlejoux commented 8 years ago

You were right, for some reason the component was rerendering.

clindsey commented 7 years ago

remember to spell the properties correctly appID instead of appId. If this prop was set to isRequired, it would make the mistake much easier to find. Why isn't it set to required already? What's the use case for an Intercom widget that's not connected to any app?