question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import https://github.com/websockets/ws

See original GitHub issue

Hi, I cannot importhttps://github.com/websockets/ws module into library. The webpack throws errors and I dot known how repair it.

Can you help me please? Thx!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Bezdekmcommented, Sep 22, 2016

Oh sorry, no. I have lowercase w in code.

I got this errors:

WARNING in ./~/bufferutil/~/bindings/bindings.js
Critical dependencies:
76:22-40 the request of a dependency is an expression
76:43-53 the request of a dependency is an expression
 @ ./~/bufferutil/~/bindings/bindings.js 76:22-40 76:43-53

WARNING in ./~/bufferutil/~/bindings/README.md

Module parse failed: /Users/martin/Desktop/Projects/cimie.cz/node_modules/bufferutil/node_modules/bindings/README.md Line 2: Unexpected
token ===
You may need an appropriate loader to handle this file type.
| node-bindings
| =============
| ### Helper module for loading your native module's .node file
|
 @ ./~/bufferutil/~/bindings ^\.\/.*$

WARNING in ./~/bufferutil/~/bindings/package.json
Module parse failed: /Users/martin/Desktop/Projects/cimie.cz/node_modules/bufferutil/node_modules/bindings/package.json Line 2: Unexpect
ed token :
You may need an appropriate loader to handle this file type.
| {
|   "name": "bindings",
|   "description": "Helper module for loading your native module's .node file",
|   "keywords": [
 @ ./~/bufferutil/~/bindings ^\.\/.*$
WARNING in ./~/utf-8-validate/~/bindings/README.md
Module parse failed: /Users/martin/Desktop/Projects/cimie.cz/node_modules/utf-8-validate/node_modules/bindings/README.md Line 2: Unexpec
ted token ===
You may need an appropriate loader to handle this file type.
| node-bindings
| =============
| ### Helper module for loading your native module's .node file
|

 @ ./~/utf-8-validate/~/bindings ^\.\/.*$

WARNING in ./~/utf-8-validate/~/bindings/package.json
Module parse failed: /Users/martin/Desktop/Projects/cimie.cz/node_modules/utf-8-validate/node_modules/bindings/package.json Line 2: Unex
pected token :
You may need an appropriate loader to handle this file type.
| {
|   "name": "bindings",
|   "description": "Helper module for loading your native module's .node file",
|   "keywords": [
 @ ./~/utf-8-validate/~/bindings ^\.\/.*$

ERROR in ./~/ws/~/options/lib/options.js
Module not found: Error: Cannot resolve module 'fs' in /Users/martin/Desktop/Projects/cimie.cz/node_modules/ws/node_modules/options/lib
 @ ./~/ws/~/options/lib/options.js 6:9-22

ERROR in ./~/bufferutil/~/bindings/bindings.js
Module not found: Error: Cannot resolve module 'fs' in /Users/martin/Desktop/Projects/cimie.cz/node_modules/bufferutil/node_modules/bind
ings
 @ ./~/bufferutil/~/bindings/bindings.js 6:9-22

ERROR in ./~/utf-8-validate/~/bindings/bindings.js
Module not found: Error: Cannot resolve module 'fs' in /Users/martin/Desktop/Projects/cimie.cz/node_modules/utf-8-validate/node_modules/
bindings
 @ ./~/utf-8-validate/~/bindings/bindings.js 6:9-22
1reaction
calebissharpcommented, Oct 26, 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). See this issue. Socket.io will work in the browser as well

Read more comments on GitHub >

github_iconTop Results From Across the Web

ws: a Node.js WebSocket library - GitHub
ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and server implementation. Passes the quite extensive Autobahn test suite:...
Read more >
WebSockets and Node.js - testing WS and SockJS by building ...
First, require the WS library and use the WebSocket.Server method to create a new WebSocket server on port 7071 (no significance, any port...
Read more >
ws - npm
Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js. Latest version: 8.11.0, last published: 2 months ...
Read more >
Introduction | Socket.IO
... Kotlin: https://github.com/icerockdev/moko-socket-io. Here's a basic example with plain WebSockets: Server (based on ws). import ...
Read more >
Examples — websocket-client 1.4.2 documentation
You may encounter problems if using SSL/TLS with your proxy. WebSocket HTTP proxy with authentication example. import websocket ws = websocket.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found