obs-websocket-community-projects / obs-websocket-js

Consumes https://github.com/obsproject/obs-websocket
MIT License
667 stars 96 forks source link

Module not found: Error: Can't resolve 'net' in 'C:\ ...\ProjectName\node_modules\obs-websocket-js\node_modules\ws\lib' #132

Closed DaleSalcedo closed 5 years ago

DaleSalcedo commented 5 years ago

import OBSWebSocket from 'obs-websocket-js';

I'm just trying to start as simply as using that above line of code, but I get the error below and I'm not sure why. It's a fresh install with "npm install obs-websocket-js --save".

I just want to use this library, please help thanks.

ERROR in ./node_modules/obs-websocket-js/node_modules/ws/lib/websocket.js Module not found: Error: Can't resolve 'net' in 'D:\WebProjects\SingularOverlayDemo\node_modules\obs-websocket-js\node_modules\ws\lib' @ ./node_modules/obs-websocket-js/node_modules/ws/lib/websocket.js 7:12-26 @ ./node_modules/obs-websocket-js/node_modules/ws/index.js @ ./node_modules/obs-websocket-js/es5/Socket.js @ ./node_modules/obs-websocket-js/es5/OBSWebSocket.js @ ./node_modules/obs-websocket-js/es5/index.js @ ./src/components/App.js @ ./src/components/Root.js @ ./src/index.js @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true ./src/index.js ERROR in ./node_modules/obs-websocket-js/node_modules/ws/lib/websocket.js Module not found: Error: Can't resolve 'tls' in 'D:\WebProjects\SingularOverlayDemo\node_modules\obs-websocket-js\node_modules\ws\lib' @ ./node_modules/obs-websocket-js/node_modules/ws/lib/websocket.js 8:12-26 @ ./node_modules/obs-websocket-js/node_modules/ws/index.js @ ./node_modules/obs-websocket-js/es5/Socket.js @ ./node_modules/obs-websocket-js/es5/OBSWebSocket.js @ ./node_modules/obs-websocket-js/es5/index.js @ ./src/components/App.js @ ./src/components/Root.js @ ./src/index.js @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true ./src/index.js

Versions Used (if applicable):

Using React / Redux boilerplate https://github.com/coryhouse/react-slingshot

RedAlexDad commented 5 months ago

Good day! How did you solve the problem?