Azure / azure-relay-node

☁️Node.js library for Azure Relay Hybrid Connections
https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-what-is-it
MIT License
12 stars 15 forks source link

Using hyco-ws with Webpack #17

Closed shmuelzalmanov closed 6 years ago

shmuelzalmanov commented 6 years ago

Actual Behavior

  1. I should be able to compile

Expected Behavior

  1. I get errors related to modules and I can't compile - Module not found: Error: Can't resolve 'tls' in '..../node_modules/ws/lib'

Versions

dlstucki commented 6 years ago

Does the same issue occur if you just try to use "ws" module?

shmuelzalmanov commented 6 years ago

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

dlstucki commented 6 years ago

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)."