Skip to content

Upstreaming libp2p broke NodeJS support of the web-client #2301

@sisou

Description

@sisou

General information

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?

image

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.

Metadata

Metadata

Labels

WASMbugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions