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.

SockJS crashes session

See original GitHub issue

I am getting frequency crashes due to an apparent SockJS session timeout:

/home/tquetano/git/platform-js/node_modules/webpack-dev-server/node_modules/sockjs/lib/trans-websocket.js:157
      return this.session.close(3000, 'No response from heartbeat');
                         ^

TypeError: Cannot read property 'close' of null
    at WebSocketReceiver.heartbeat_timeout (/home/tquetano/git/platform-js/node_modules/webpack-dev-server/node_modules/sockjs/lib/trans-websocket.js:157:26)
    at null._onTimeout (/home/tquetano/git/platform-js/node_modules/webpack-dev-server/node_modules/sockjs/lib/trans-websocket.js:75:24)
    at Timer.listOnTimeout (timers.js:92:15)

npm ERR! Linux 4.4.0-18-generic
npm ERR! argv "/home/tquetano/.nvm/versions/node/v4.2.2/bin/node" "/home/tquetano/.nvm/versions/node/v4.2.2/bin/npm" "run" "dev"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! platform@4.0.0 dev: `NODE_ENV=development ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --progress`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the platform@4.0.0 dev script 'NODE_ENV=development ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --progress'.
npm ERR! This is most likely a problem with the platform package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_ENV=development ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --progress
npm ERR! You can get their info via:
npm ERR!     npm owner ls platform
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/tquetano/git/platform-js/npm-debug.log

Is there a way to configure to increase the timeout, or at least check for the existence of the session object before attempting to use its close property? This is happening very frequently, in some cases in as little as a few minutes after very basic usage

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
skozincommented, May 3, 2016

@csaintc @byCedric btw, removing your node_modules directory and doing fresh npm install should fix the issue as well, as the new sockjs version 0.3.17 matches the semver ^0.3.15 specified in webpack-dev-server’s package.js. If this doesn’t help, you can manually npm install sockjs@0.3.17.

I suggest updating semver in dev-server’s package.json only to enforce installation of the new sockjs version in all cases, e.g. behind a caching npm proxy.

0reactions
tquetano-r7commented, Aug 2, 2016

Nope, sorry I should have closed this a while ago.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Websockets via STOMP - Client crash and ...
I'm implementing a Spring web application using Websocket, the sub protocol STOMP as well as SockJs for Fallback.
Read more >
sockjs@0.2.0 vulnerabilities - Snyk
Affected versions of this package are vulnerable to Denial of Service (DoS). Incorrect handling of Upgrade header with the value websocket leads in...
Read more >
Sending Message to a specific session on Spring Websocket
So in this post i will explain how i achieved sending updates to specific session. Step 1: Angular Application Subscribes to Websocket &...
Read more >
WebSockets and Load Balancers: How to Use Them - Zibtek
Load balancing refers to the act of distributing network traffic across multiple services. This makes sure that there's not too much load on...
Read more >
Vert.x Web
Session support - both local (for sticky sessions) and clustered (for non ... is stored in the Cookie, this means sessions survive server...
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