devrnt / react-use-intercom

☎️ React Intercom integration without the hassle, powered by hooks.
https://devrnt.github.io/react-use-intercom/#/useIntercom
MIT License
337 stars 43 forks source link

Uncaught TypeError: Cannot read properties of null (reading 'instantBootEnabled') #680

Closed the-phoenix closed 1 month ago

the-phoenix commented 1 month ago

While using intercom on my react project. I can see this error. Uncaught TypeError: Cannot read properties of null (reading 'instantBootEnabled') I'm not sure It caused suddenly. It worked till now.

Here is my code:

const { boot } = useIntercom();
useEffect(() => {
  boot({
    customAttributes: {
      horizontal_padding: 25,
    },
  });
}, [boot]);
AaronPowell96 commented 1 month ago

This has just started occurring for us over the past couple of days too, unaware of any code changes our side that caused this.

anibe commented 1 month ago

I was getting this earlier but now seems to have fixed itself. The exception originated from https://js.intercomcdn.com/frame-modern.xxx.js so perhaps it was a wider problem with Intercom rather than this library.

jose-mdz commented 1 month ago

Same problem

theseyi commented 1 month ago

Also seeing this intermittently under local development

jannikbertram commented 1 month ago

This seems to be crashing our web app quite frequently in production. Here is a full stacktrace

{
  message: null is not an object (evaluating 'e.instantBootEnabled'),
  name: TypeError,
  stack: 
@https://js.intercomcdn.com/frame.9a0e43ba.js:2:657609
v@https://js.intercomcdn.com/vendor.989ae25f.js:2:535589
@https://js.intercomcdn.com/vendor.989ae25f.js:2:537066
v@https://js.intercomcdn.com/vendor.989ae25f.js:2:535589
@https://js.intercomcdn.com/vendor.989ae25f.js:2:537032
v@https://js.intercomcdn.com/vendor.989ae25f.js:2:535589
@https://js.intercomcdn.com/frame.9a0e43ba.js:2:659107
@https://js.intercomcdn.com/vendor.989ae25f.js:2:584026
forEach@[native code]
m@https://js.intercomcdn.com/vendor.989ae25f.js:2:584019
dispatch@https://js.intercomcdn.com/vendor.989ae25f.js:2:550272
@https://js.intercomcdn.com/frame.9a0e43ba.js:2:609920
@https://js.intercomcdn.com/frame.9a0e43ba.js:2:565249
@https://js.intercomcdn.com/frame.9a0e43ba.js:2:563866
@https://js.intercomcdn.com/frame.9a0e43ba.js:2:558823
@https://js.intercomcdn.com/frame.9a0e43ba.js:2:566465
@https://js.intercomcdn.com/vendor.989ae25f.js:2:561681
@https://js.intercomcdn.com/frame.9a0e43ba.js:2:632589
@https://js.intercomcdn.com/frame.9a0e43ba.js:2:671283
shutdown@https://js.intercomcdn.com/frame.9a0e43ba.js:2:690621
@https://<our-web-app>/_next/static/chunks/pages/_app-4f5322db7c0bcefe.js:65:2362803
[...]
}
lieberkind commented 1 month ago

We're also seeing this error in Sentry, but we're not using react-use-intercom, adding to @anibe's point that this might be related to Intercom itself. We're still seeing the errors though.

yonitou commented 1 month ago

Same issue !

cookpete commented 1 month ago

We ended up wrapping the boot() call with a try/catch – not ideal, but seems to have stopped it from crashing our entire app.

jannikbertram commented 1 month ago

We ended up wrapping the boot() call with a try/catch – not ideal, but seems to have stopped it from crashing our entire app.

We did the same. @cookpete do you know what happens if boot() fails. Is Intercom just not showing in that session? And does it work again when refreshing the page?

cookpete commented 1 month ago

When boot() caused an instantBootEnabled error it would get caught by our ErrorBoundary and show our error page, preventing users from using the app. Although they could still open the Sentry report dialog to report the problem. Sentry showed the instantBootEnabled trace but Fullstory just showed a console error of {}, which is a bit confusing.

This only happened for a small number of users and we couldn’t see any patterns or clues as to why it happens.

anibe commented 1 month ago

Update: I raised a support request with Intercom directly and they have confirmed that this is a known issue they are planning to fix. No indication on how soon though.

theseyi commented 1 month ago

@anibe do you have a link to the support request?

anibe commented 1 month ago

@theseyi no link as it was an internal request.

They have come back to say the issue has been fixed, hopefully it should be fixed for everyone here too 🤞

image

devrnt commented 1 month ago

I'm happy to hear that Intercom resolved the issue Thanks for the updates!