Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis run failing on node 0.10/0.12 due to unpinnned socket.io-client #1167

Closed
edmorley opened this issue May 10, 2017 · 3 comments
Closed

Comments

@edmorley
Copy link

The Travis run is failing on node 0.10/0.12 with:

/home/travis/build/nodejitsu/node-http-proxy/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/index.js:9
const WebSocket = require('./lib/WebSocket');
^^^^^
...
  1) lib/http-proxy.js #createProxyServer using the ws-incoming passes should proxy a socket.io stream:
     SyntaxError: Use of const in strict mode.
      at Server.init (node_modules/socket.io/node_modules/engine.io/lib/server.js:119:16)
      at new Server (node_modules/socket.io/node_modules/engine.io/lib/server.js:65:8)
      at Function.attach (node_modules/socket.io/node_modules/engine.io/lib/engine.io.js:123:16)
      at node_modules/socket.io/lib/index.js:258:23
      at Encoder.encode (node_modules/socket.io/node_modules/socket.io-parser/index.js:138:5)
      at Server.listen.Server.attach (node_modules/socket.io/lib/index.js:251:16)
      at new Server (node_modules/socket.io/lib/index.js:57:17)
      at Function.Server (node_modules/socket.io/lib/index.js:43:41)
      at Context.<anonymous> (test/lib-http-proxy-test.js:432:20)

(for example https://travis-ci.org/nodejitsu/node-http-proxy/jobs/230765815)

The package ws has dropped support for these versions of node:
websockets/ws#1077

Options are to:

  • Drop support for those versions of node from node-http-proxy too (they are EOL after all)
  • Pin to ws version 1.x. However engine.io-client 3.x explicitly requires ws 2.x, so we'd need to pin to engine.io-client 2.x (the latest of which is 2.2.1), which would mean falling back from socket.io-client 2.x to 1.7.4.

Note at the moment that node-http-proxy doesn't pin socket.io-client or many other devDependencies at all:

  "devDependencies": {
    "async": "*",
    "blanket": "*",
    "coveralls": "*",
    "dox": "*",
    "expect.js": "*",
    "mocha": "*",
    "mocha-lcov-reporter": "*",
    "semver": "^5.0.3",
    "socket.io": "*",
    "socket.io-client": "*",
    "sse": "0.0.6",
    "ws": "^0.8.0"
},
@edmorley
Copy link
Author

Which of the options (dropping support for EOL nodejs or pinning multiple dependencies) is preferred?

Happy to open a PR once confirmed..

@edmorley
Copy link
Author

Which of the options (dropping support for EOL nodejs or pinning multiple dependencies) is preferred?

@indexzero do you have a preference? :-)

@swillis12
Copy link
Contributor

Same failure is happening for mocha too... hoping this project is active enough to get #1235 merged in but that might be wishful thinking:

/home/travis/build/nodejitsu/node-http-proxy/node_modules/mocha/bin/mocha:10
const spawn = require('child_process').spawn;
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:945:3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants