question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot read property 'setStateIdle' of null

See original GitHub issue

I’m getting the following error in Chrome 66 when accessing a pad in our instance (running 1.6.6). Meanwhile, access with Firefox 60 works without problems. Any tips?

An error occurred
The error was reported with the following id: 'qZF4pJdMtrdhNgDJlfp0'

Please press and hold Ctrl and press F5 to reload this page, if the problem persists please send this error message to your webmaster:
'ErrorId: qZF4pJdMtrdhNgDJlfp0
URL: https://pad.example.com/padname
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
Uncaught TypeError: Cannot read property 'setStateIdle' of null in https://pad.example.com/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define at line 3'

It seems to stem from this code section, where pad.collabClient seems to be null:

            socket.on("error", function(e) {
                pad.collabClient.setStateIdle(),
                pad.collabClient.setIsPendingRevision(!0)
            });

When pausing with a breakpoint, the error e is undefined.

According to the call stack, the error occurred in this call:

            io.connect(n, {
                path: exports.baseURL + "socket.io",
                resource: a,
                reconnectionAttempts: 5,
                reconnection: !0,
                reconnectionDelay: 1e3,
                reconnectionDelayMax: 5e3
            })

P.S.: It’s actually suprising that pad.collabClient is already used in the handshake(), while it is only initialized in _afterHandshake().

P.P.S.: Troubleshooting information as follows:

Etherpad version

Version number: 1.6.6

Git sha: 7e69a82
Installed plugins

ep_etherpad-lite

Installed parts

ep_etherpad-lite/swagger
ep_etherpad-lite/adminsettings
ep_etherpad-lite/adminplugins
ep_etherpad-lite/admin
ep_etherpad-lite/tests
ep_etherpad-lite/socketio
ep_etherpad-lite/errorhandling
ep_etherpad-lite/importexport
ep_etherpad-lite/apicalls
ep_etherpad-lite/webaccess
ep_etherpad-lite/padreadonly
ep_etherpad-lite/padurlsanitize
ep_etherpad-lite/specialpages
ep_etherpad-lite/i18n
ep_etherpad-lite/static
ep_etherpad-lite/express

Installed hooks
Server side hooks

expressCreateServer
    ep_etherpad-lite/node/hooks/express/swagger:expressCreateServer from ep_etherpad-lite/swagger
expressCreateServer
    ep_etherpad-lite/node/hooks/express/adminsettings:expressCreateServer from ep_etherpad-lite/adminsettings
expressCreateServer
    ep_etherpad-lite/node/hooks/express/adminplugins:expressCreateServer from ep_etherpad-lite/adminplugins
expressCreateServer
    ep_etherpad-lite/node/hooks/express/admin:expressCreateServer from ep_etherpad-lite/admin
expressCreateServer
    ep_etherpad-lite/node/hooks/express/tests:expressCreateServer from ep_etherpad-lite/tests
expressCreateServer
    ep_etherpad-lite/node/hooks/express/socketio:expressCreateServer from ep_etherpad-lite/socketio
expressCreateServer
    ep_etherpad-lite/node/hooks/express/errorhandling:expressCreateServer from ep_etherpad-lite/errorhandling
expressCreateServer
    ep_etherpad-lite/node/hooks/express/importexport:expressCreateServer from ep_etherpad-lite/importexport
expressCreateServer
    ep_etherpad-lite/node/hooks/express/apicalls:expressCreateServer from ep_etherpad-lite/apicalls
expressCreateServer
    ep_etherpad-lite/node/hooks/express/padreadonly:expressCreateServer from ep_etherpad-lite/padreadonly
expressCreateServer
    ep_etherpad-lite/node/hooks/express/padurlsanitize:expressCreateServer from ep_etherpad-lite/padurlsanitize
expressCreateServer
    ep_etherpad-lite/node/hooks/express/specialpages:expressCreateServer from ep_etherpad-lite/specialpages
expressCreateServer
    ep_etherpad-lite/node/hooks/i18n:expressCreateServer from ep_etherpad-lite/i18n
expressCreateServer
    ep_etherpad-lite/node/hooks/express/static:expressCreateServer from ep_etherpad-lite/static
socketio
    ep_etherpad-lite/node/hooks/express/adminsettings:socketio from ep_etherpad-lite/adminsettings
socketio
    ep_etherpad-lite/node/hooks/express/adminplugins:socketio from ep_etherpad-lite/adminplugins
expressConfigure
    ep_etherpad-lite/node/hooks/express/webaccess:expressConfigure from ep_etherpad-lite/webaccess
createServer
    ep_etherpad-lite/node/hooks/express:createServer from ep_etherpad-lite/express
restartServer
    ep_etherpad-lite/node/hooks/express:restartServer from ep_etherpad-lite/express

Client side hooks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:34 (19 by maintainers)

github_iconTop GitHub Comments

3reactions
muxatorcommented, Aug 14, 2018

Good news, @fralix. Good documentation is precious.

I leave the issue open, since I continue being curious about the “phantom” initialization uncovered by @caugner.

I am starting to think about how to improve the codebase without rewriting it (more tests, linters, static analyzers, maybe even gradually migrating to TypeScript…), and this sort of issues interest me a lot.

1reaction
lvarnavacommented, Jun 23, 2020

This error is reproduced on different instances of the etherpads in the android and chrome. Tested on my own server and on https://etherpad.wikimedia.org, https://video.etherpad.com.

An error occurred Please press and hold Ctrl and press F5 to reload this page If the problem persists please send this error message to your webmaster:

ErrorId: XDmLq2ENraoB3lM4ESfu URL: https://etherpad.wikimedia.org/p/gxz0C7Rncg-J80ra7DQw UserAgent: Mozilla/5.0 (Linux; Android 10; Mi A2 Lite) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Mobile Safari/537.36 Uncaught TypeError: Cannot read property ‘setStateIdle’ of null in https://etherpad.wikimedia.org/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define&v=f2b033c9 at line 3

Steps to reproduce

  1. in chrome browser open a new pad
  2. write something
  3. then click on “home” in the android
  4. then through the “last applications” close everything
  5. and run chrome browser again
  6. it will start to open your last pad and give this error
Read more comments on GitHub >

github_iconTop Results From Across the Web

Etherpad - Cannot read property 'setStateIdle' of null
Hello,. once again I have a quick workaround for issues we've been noticing recently with Google Chrome. Google has changed their cookie policy...
Read more >
Uncaught TypeError: Cannot read property of null - iDiallo
This will result in Uncaught TypeError: Cannot read property 'value' of null . The reason will be that the element with id input...
Read more >
Embedding the board.net boards stopped working on Chrome
... like Gecko) Chrome/84.0.4147.105 Safari/537.36 Uncaught TypeError: Cannot read property 'setStateIdle' of null in ...
Read more >
TypeError: Cannot read property state of null - Stack Overflow
The first time the component renders, this.state.financials is null , because you are initializing it with null : state = { financials: null...
Read more >
uncaught typeerror: cannot read properties of null ... - You.com
Uncaught TypeError : Cannot read properties of null (reading 'querySelector'). At this step the tags input is showing NULL. It does not contain...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found