Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

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

Open
perrin4869 opened this issue Aug 16, 2016 · 14 comments
Open

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

perrin4869 opened this issue Aug 16, 2016 · 14 comments

Comments

@perrin4869
Copy link
Contributor

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/[email protected] -> npm:socket.io-client@^1.3.7? [Yes]:
@guybedford
Copy link
Member

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

@perrin4869
Copy link
Contributor Author

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
Copy link
Contributor Author

I get this error when I try to use npm:[email protected]:

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/[email protected]/child_process.js:1:7)
        at Object.eval (http://localhost:3000/client/jspm_packages/npm/[email protected]/lib/XMLHttpRequest.js:16:37)
        at eval (http://localhost:3000/client/jspm_packages/npm/[email protected]/lib/XMLHttpRequest.js:648:4)
        at eval (http://localhost:3000/client/jspm_packages/npm/[email protected]/lib/XMLHttpRequest.js:649:3)
    Evaluating http://localhost:3000/client/jspm_packages/github/jspm/[email protected]/child_process.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/[email protected]/lib/XMLHttpRequest.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/[email protected]/lib/transports/index.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/[email protected]/lib/socket.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/[email protected]/lib/index.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/[email protected]/index.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/[email protected]/lib/manager.js
    Evaluating http://localhost:3000/client/jspm_packages/npm/[email protected]/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
Copy link
Member

Is this with jspm 0.16 or jspm 0.17?

@perrin4869
Copy link
Contributor Author

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

@guybedford
Copy link
Member

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
Copy link
Contributor Author

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

@perrin4869
Copy link
Contributor Author

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
Copy link
Member

guybedford commented Sep 19, 2016

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

@calbertts
Copy link

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

@amitport
Copy link

amitport commented Nov 9, 2016

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

@amitport
Copy link

amitport commented Nov 9, 2016

not sure why but removing

"xmlhttprequest-ssl": "npm:[email protected]",
"ws": "npm:[email protected]",
"node-xmlhttprequest-ssl": "npm:[email protected]",
"node-ws": "npm:[email protected]"

from npm:[email protected] 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:[email protected]": {
        "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
Copy link
Contributor Author

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

@leipzig
Copy link

leipzig commented Oct 9, 2017

still seeing this from [email protected]

system.js?1507582324818:4 Uncaught (in promise) Error: The NodeJS "child_process" module is not available in the browser.
  Evaluating /jspm_packages/npm/[email protected]/child_process.js
  Evaluating /jspm_packages/npm/[email protected]/lib/XMLHttpRequest.js
  Evaluating /jspm_packages/npm/[email protected]/lib/transports/index.js
  Evaluating /jspm_packages/npm/[email protected]/lib/socket.js
  Evaluating /jspm_packages/npm/[email protected]/lib/index.js
  Evaluating /jspm_packages/npm/[email protected]/index.js
  Evaluating /jspm_packages/npm/[email protected]/lib/manager.js
  Evaluating /jspm_packages/npm/[email protected]/lib/index.js
  Evaluating /reactive_html/dev/scripts/modules/table/init.js
  Evaluating /reactive_html/dev/scripts/table.js

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

No branches or pull requests

5 participants