remote-redux-devtools: Unknown module "ws" exception on Windows

screenshot_2016-08-21-13-40-42 1

I’m developing on windows 10 + android 5.0 device. After installing remote-redux-devtools as described on readme.md i got the error Requiring unknown module “url” It seems socketcluster-client uses ws/WebSocket.js and do a require(“url”) and this raises the error

On the web I have not found similar problems so I’m worried this happen only to me

this my package.json `{

“version”: “0.0.1”, “private”: true, “scripts”: { “start”: “node node_modules/react-native/local-cli/cli.js start” }, “dependencies”: { “react”: “15.2.1”, “react-native”: “0.30.0”, “react-redux”: “^4.4.5”, “redux”: “^3.5.2” }, “devDependencies”: { “remote-redux-devtools”: “^0.4.2” } }`

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 56 (23 by maintainers)

Commits related to this issue

Most upvoted comments

I published a change which may fix the issue - You should use npm to upgrade to socketcluster-client version 5.0.4.

If it still doesn’t work after the upgrade, try adding:

"react-native": {
   "ws: "./lib/ws-browser.js"
 }

to your node_modules/socketcluster-client/package.json.

See https://github.com/facebook/react-native/pull/2208#issue-98660420

That bugfix is available on react-native@v0.41.0-rc.0. So, you should either upgrade react-native to RC or downgrade remote-redux-devtools to 0.5.0. See https://github.com/zalmoxisus/remote-redux-devtools/issues/62#issuecomment-271882723 for details.

I will try in the next days

The fix seems to be merged on React Native. I’ve updated socketcluster-client in v0.5.1 in order to get support for web workers.

Unfortunately, I wasn’t able to get React Native work on a virtual machine. It would be welcome if someone could test that it works as expected on Windows.

@zalmoxisus v4 client should be compatible with v5 server - But you should try it out first just to make sure.

The problem is ws-sc replace himself to the browser.js and ws doesn’t.

Since ws have to be used (isn’t it?) the only way to replace ‘ws’ is by using “browser” field in the depending package (like socketcluster-client) but it fails in react-native

The solutions are: 1 - wait for react-native bug-fix 2 - use ws-scinstead of ws in the next socketcluster-client releases

@jondubois, it works now. Thanks a lot for the quick fixes and all the details!