Closed shmuelzalmanov closed 6 years ago
Does the same issue occur if you just try to use "ws" module?
Yes, here are the webpack logs ...
WARNING in ./node_modules/ws/lib/buffer-util.js Module not found: Error: Can't resolve 'bufferutil' in '..../node_modules/ws/lib' @ ./node_modules/ws/lib/buffer-util.js 56:21-42 @ ./node_modules/ws/lib/receiver.js @ ./node_modules/ws/index.js ... @ ./src/main.js @ ./node_modules/aurelia-webpack-plugin/dist/aurelia-entry.js @ multi aurelia-webpack-plugin/dist/aurelia-entry aurelia-polyfills aurelia-loader-webpack (webpack)-dev-server/client?http://localhost:8080 aurelia-bootstrapper
WARNING in ./node_modules/ws/lib/validation.js Module not found: Error: Can't resolve 'utf-8-validate' in '...../node_modules/ws/lib' @ ./node_modules/ws/lib/validation.js 4:22-47 @ ./node_modules/ws/lib/receiver.js @ ./node_modules/ws/index.js .... @ ./src/main.js @ ./node_modules/aurelia-webpack-plugin/dist/aurelia-entry.js @ multi aurelia-webpack-plugin/dist/aurelia-entry aurelia-polyfills aurelia-loader-webpack (webpack)-dev-server/client?http://localhost:8080 aurelia-bootstrapper
ERROR in ./node_modules/ws/lib/websocket.js Module not found: Error: Can't resolve 'net' in '...../node_modules/ws/lib' @ ./node_modules/ws/lib/websocket.js 7:12-26 @ ./node_modules/ws/index.js .... @ ./src/main.js @ ./node_modules/aurelia-webpack-plugin/dist/aurelia-entry.js @ multi aurelia-webpack-plugin/dist/aurelia-entry aurelia-polyfills aurelia-loader-webpack (webpack)-dev-server/client?http://localhost:8080 aurelia-bootstrapper
ERROR in ./node_modules/ws/lib/websocket.js Module not found: Error: Can't resolve 'tls' in '..../node_modules/ws/lib' @ ./node_modules/ws/lib/websocket.js 8:12-26 @ ./node_modules/ws/index.js ... @ ./src/main.js @ ./node_modules/aurelia-webpack-plugin/dist/aurelia-entry.js @ multi aurelia-webpack-plugin/dist/aurelia-entry aurelia-polyfills aurelia-loader-webpack (webpack)-dev-server/client?http://localhost:8080 aurelia-bootstrapper
Is this other thread applicable?
https://github.com/krasimir/webpack-library-starter/issues/6#issuecomment-256219200
"calebissharp commented on Oct 25 2016 The 'ws' library cannot be used in a browser context. You have to use WebSockets API directly (https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)."
Actual Behavior
Expected Behavior
Versions