intercom-rails icon indicating copy to clipboard operation
intercom-rails copied to clipboard

Uncaught TypeError: Cannot read property 'appId' of null

Open summera opened this issue 6 years ago • 7 comments

Version info

  • intercom-rails version: 0.3.5
  • Rails version: 5.1.4

Expected behavior

No error.

Actual behavior

Receiving Uncaught TypeError: Cannot read property 'appId' of null in console in one of our testing environments and then the Messenger does not show. What's interesting, is this is not happening in our production environment. The testing environment and production environment are using separate Intercom apps. I'm using Turbolinks and it seems to happen on a Turbolinks page load (rather than a full page load) and when using the back button. This is happening in Chrome 67.0.3396.99. I've tried clearing cache and cookies for the domain and that doesn't fix. I don't see the error in Chrome Incognito mode or in Firefox.

Logs

VM206 frame.33e73fb5.js:1 Uncaught TypeError: Cannot read property 'appId' of null
    at c.t.mapStateToProps [as finalMapStateToProps] (VM206 frame.33e73fb5.js:1)
    at c.computeStateProps (VM206 frame.33e73fb5.js:1)
    at c.updateStatePropsIfNeeded (VM206 frame.33e73fb5.js:1)
    at s (VM206 frame.33e73fb5.js:1)
    at c.handleChange (VM206 frame.33e73fb5.js:1)
    at l (VM206 frame.33e73fb5.js:1)
    at VM206 frame.33e73fb5.js:1
    at VM206 frame.33e73fb5.js:1
    at VM206 frame.33e73fb5.js:1
    at VM206 frame.33e73fb5.js:1
    at VM206 frame.33e73fb5.js:1
    at VM206 frame.33e73fb5.js:1
    at VM206 frame.33e73fb5.js:1
    at VM206 frame.33e73fb5.js:1
    at Object.dispatch (VM206 frame.33e73fb5.js:1)
    at e.destroy (VM206 frame.33e73fb5.js:1)
    at e.destroySession (VM206 frame.33e73fb5.js:1)
    at Object.shutdown (VM206 frame.33e73fb5.js:1)
    at VM206 frame.33e73fb5.js:1
    at HTMLDocument.y (shim.86cccbeb.js:1)
    at HTMLDocument.e.bugsnag (application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:11)
    at Object.e.dispatch (application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:10)
    at n.notifyApplicationAfterVisitingLocation (application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:11)
    at n.startVisit (application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:11)
    at n.historyPoppedToLocationWithRestorationIdentifier (application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:11)
    at n.onPopState (application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:10)
    at application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:10
t.mapStateToProps @ VM206 frame.33e73fb5.js:1
c.computeStateProps @ VM206 frame.33e73fb5.js:1
c.updateStatePropsIfNeeded @ VM206 frame.33e73fb5.js:1
s @ VM206 frame.33e73fb5.js:1
c.handleChange @ VM206 frame.33e73fb5.js:1
l @ VM206 frame.33e73fb5.js:1
(anonymous) @ VM206 frame.33e73fb5.js:1
(anonymous) @ VM206 frame.33e73fb5.js:1
(anonymous) @ VM206 frame.33e73fb5.js:1
(anonymous) @ VM206 frame.33e73fb5.js:1
(anonymous) @ VM206 frame.33e73fb5.js:1
(anonymous) @ VM206 frame.33e73fb5.js:1
(anonymous) @ VM206 frame.33e73fb5.js:1
(anonymous) @ VM206 frame.33e73fb5.js:1
(anonymous) @ VM206 frame.33e73fb5.js:1
e.destroy @ VM206 frame.33e73fb5.js:1
e.destroySession @ VM206 frame.33e73fb5.js:1
shutdown @ VM206 frame.33e73fb5.js:1
(anonymous) @ VM206 frame.33e73fb5.js:1
y @ shim.86cccbeb.js:1
e.bugsnag @ application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:11
e.dispatch @ application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:10
n.notifyApplicationAfterVisitingLocation @ application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:11
n.startVisit @ application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:11
n.historyPoppedToLocationWithRestorationIdentifier @ application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:11
n.onPopState @ application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:10
(anonymous) @ application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:10
application-d59dced96c29ca862c6a80fba0b2af5d765061252cc66fb0851760e10d3d13f9.js:11 

summera avatar Jul 10 '18 22:07 summera

I have the same issue.

In my case the issue persist for both environment.

Any ideas?

jpdelorenzo avatar Jul 23 '18 13:07 jpdelorenzo

@SeanHealy33 any idea what's going on here?

summera avatar Jul 26 '18 14:07 summera

This happens when I call (window as any).Intercom('shutdown'); in my angular app

adnan-kamili avatar Jul 27 '18 06:07 adnan-kamili

Try remove the intercom cookies https://github.com/mike-north/ember-intercom-io/issues/149

andychongyz avatar Aug 03 '18 03:08 andychongyz

Any update?

jpdelorenzo avatar Aug 28 '18 19:08 jpdelorenzo

I just experienced this as well. Our Intercom is installed via Segment 1.1

Uncaught (in promise) TypeError: Cannot read property 'appId' of null
    at frame.919fe903.js:25
    at frame.919fe903.js:25
    at frame.919fe903.js:25
    at frame.919fe903.js:25
    at frame.919fe903.js:25
    at frame.919fe903.js:11
    at frame.919fe903.js:25
    at dispatch (frame.919fe903.js:25)
    at Object.<anonymous> (frame.919fe903.js:11)
    at o (frame.919fe903.js:25)
    at Generator._invoke (frame.919fe903.js:25)
    at Generator.e.(anonymous function) [as next] (https://js.intercomcdn.com/frame.919fe903.js:25:84907)
    at o (frame.919fe903.js:11)
    at frame.919fe903.js:11

MatthewHerbst avatar Dec 03 '18 03:12 MatthewHerbst

I have been seeing this as well. What I think is happening is that the shutdown call runs while Intercom process is loading (not 100% certain). My current work around is to add a delay to the shutdown:

setTimeout( () => {window.Intercom('shutdown')}, 600)

foureight84 avatar Dec 05 '18 20:12 foureight84