oney / RCTWebRTCDemo

MIT License
215 stars 142 forks source link

Unable to resolve module url #41

Closed Doweig closed 7 years ago

Doweig commented 7 years ago

Unable to resolve module url from /Users/doweig/dev/react-native/RCTWebRTCDemo/node_modules/engine.io-client/node_modules/ws/lib/WebSocket.js: Unable to find this module in its module map or any of the node_modules directories under /Users/node_modules/url and its parent directories

Also, I had to modify the main.js file first https://github.com/oney/RCTWebRTCDemo/blob/master/main.js#L14

from

import io from 'socket.io-client/socket.io';

to

import io from 'socket.io-client';

Can react-native support node core modules?

Doweig commented 7 years ago

With socket.io-client 1.3.7 (default in packages.json) the require should be

import io from 'socket.io-client/dist/socket.io';

Fixed it for me

zxcpoiu commented 7 years ago

thanks for sharing!