-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
Description
General information
- Library version(s): >= 0.19.0
- Browser version(s): NodeJS
- Devices/Simulators/Machine affected: all
- Reproducible in the testnet? (Yes/No): yes
- Related issues: feat(websocket-websys): add support for different WASM environments libp2p/rust-libp2p#4889, network-libp2p: Go back to upstream libp2p #2047
Bug report
Expected behavior
NodeJS can run the client in a worker_thread, for which I created a special entry point.
Actual behavior
The client in a NodeJS worker thread panics with 'to have a window or worker context', which is the exact panic added in libp2p/rust-libp2p#4889.
Steps to reproduce
Run the NodeJS example in the web-client/example/node. Make sure to follow the instructions in web-client/example/README.md.
Crash log? Screenshots? Videos? Sample project?
2024-03-08T20:11:56.006000128Z ERROR panic | thread '<unnamed>' panicked at 'to have a window or worker context': /home/soeren/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libp2p-websocket-websys-0.3.1/src/lib.rs:308
Question or Feature Request
Add support for NodeJS Worker Threads to libp2p's websocket-websys transport?
I need to find out how it worked before libp2p was upstreamed in #2047, as it did work before, when I added NodeJS support and the example.
