jspm / registry

The jspm registry and package.json override service
https://jspm.io
229 stars 255 forks source link

move socket.io-client from github to npm #955

Open perrin4869 opened 8 years ago

perrin4869 commented 8 years ago

Not a big deal, but would let it play nicer with other npm packages which have a dependency or a peer dependency on socket.io-client, since every time I run jspm update now I get:

Install the peer socket.io-client from github:socketio/socket.io-client@1.4.8 -> npm:socket.io-client@^1.3.7? [Yes]:
guybedford commented 8 years ago

I'd be happy to add this to the registry here if you think the npm version is a better choice now.

perrin4869 commented 8 years ago

need to test the npm version first, since last time I remember I had some problems with it. It might need some overrides to work correctly

perrin4869 commented 8 years ago

I get this error when I try to use npm:socket.io-client@1.4.8:

Uncaught (in promise) Error: (SystemJS) The NodeJS "child_process" module is not available in the browser.
    Error: The NodeJS "child_process" module is not available in the browser.
        at eval (http://localhost:3000/client/jspm_packages/github/jspm/nodelibs-child_process@0.2.0-alpha/child_process.js:1:7)
        at Object.eval (http://localhost:3000/client/jspm_packages/npm/xmlhttprequest-ssl@1.5.1/lib/XMLHttpRequest.js:16:37)
        at eval (http://localhost:3000/client/jspm_packages/npm/xmlhttprequest-ssl@1.5.1/lib/XMLHttpRequest.js:648:4)
        at eval (http://localhost:3000/client/jspm_packages/npm/xmlhttprequest-ssl@1.5.1/lib/XMLHttpRequest.js:649:3)
    Evaluating http://localhost:3000/client/jspm_packages/github/jspm/nodelibs-child_process@0.2.0-alpha/child_process.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/xmlhttprequest-ssl@1.5.1/lib/XMLHttpRequest.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/engine.io-client@1.6.11/lib/transports/index.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/engine.io-client@1.6.11/lib/socket.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/engine.io-client@1.6.11/lib/index.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/engine.io-client@1.6.11/index.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/socket.io-client@1.4.8/lib/manager.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/socket.io-client@1.4.8/lib/index.js
    Error loading http://localhost:3000/client/js/web/main.jst @ system.src.js:123p @ system.src.js:693(anonymous function) @ system.src.js:630g @ system.src.js:775b @ system.src.js:970f @ system.src.js:629m @ system.src.js:675(anonymous function) @ system.src.js:491
guybedford commented 8 years ago

Is this with jspm 0.16 or jspm 0.17?

perrin4869 commented 8 years ago

0.17 beta 25. I could reproduce it on an empty project

guybedford commented 8 years ago

I can confirm that jspm install socket.io-client in a new project and importing socket.io-client in the browser works fine for me here in the latest jspm 0.17. Just let me know if you're still having problems though.

perrin4869 commented 8 years ago

Hm... Maybe it's a cache problem again. I will clear the cache and check again tomorrow

perrin4869 commented 8 years ago

oh, yeah, just revisited this issue. socket.io-client works fine when importing from github:, which is the default in the jspm registry. However, jspm install npm:socket.io-client fails to import with the Uncaught (in promise) Error: (SystemJS) The NodeJS "child_process" module is not available in the browser. error I posted above. I tried clearing the cache, but the problem persists...

guybedford commented 8 years ago

@perrin4869 jspm install npm:socket.io-client -f && jspm run socket.io-client in jspm 0.17 definitely works for me.

calbertts commented 7 years ago

This is happening to me, not sure why or what's the dependency with the issue..

amitport commented 7 years ago

I have the same issue in the browser (jspm 0.17 beta 31). jspm run works fine though

amitport commented 7 years ago

not sure why but removing

"xmlhttprequest-ssl": "npm:xmlhttprequest-ssl@1.5.1",
"ws": "npm:ws@1.1.1",
"node-xmlhttprequest-ssl": "npm:xmlhttprequest-ssl@1.5.1",
"node-ws": "npm:ws@1.1.1"

from npm:engine.io-client@1.7.2 meta entry in jspm.config solves the issue

(those libs depend on child_process and tls which seem to cause the issue)

edit ended up adding override:

      "npm:engine.io-client@1.7.2": {
        "dependencies": {
          "component-emitter": "1.2.1",
          "component-inherit": "0.0.3",
          "debug": "2.2.0",
          "engine.io-parser": "1.3.1",
          "has-cors": "1.1.0",
          "indexof": "0.0.1",
          "parsejson": "0.0.3",
          "parseqs": "0.0.5",
          "parseuri": "0.0.5",
          "yeast": "0.1.2"
        },
        "map": {
          "xmlhttprequest-ssl": "./lib/xmlhttprequest.js",
          "./lib": "./lib/index.js",
          "./lib/transports": "./lib/transports/index.js",
          "ws": "@empty"
        }
      }
perrin4869 commented 7 years ago

Did anyone get socket.io-client@2 working with jspm?

leipzig commented 6 years ago

still seeing this from jspm@0.17.0-beta.45

system.js?1507582324818:4 Uncaught (in promise) Error: The NodeJS "child_process" module is not available in the browser.
  Evaluating /jspm_packages/npm/jspm-nodelibs-child_process@0.2.1/child_process.js
  Evaluating /jspm_packages/npm/xmlhttprequest-ssl@1.5.3/lib/XMLHttpRequest.js
  Evaluating /jspm_packages/npm/engine.io-client@3.1.2/lib/transports/index.js
  Evaluating /jspm_packages/npm/engine.io-client@3.1.2/lib/socket.js
  Evaluating /jspm_packages/npm/engine.io-client@3.1.2/lib/index.js
  Evaluating /jspm_packages/npm/engine.io-client@3.1.2/index.js
  Evaluating /jspm_packages/npm/socket.io-client@2.0.3/lib/manager.js
  Evaluating /jspm_packages/npm/socket.io-client@2.0.3/lib/index.js
  Evaluating /reactive_html/dev/scripts/modules/table/init.js
  Evaluating /reactive_html/dev/scripts/table.js