Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Compat for WebTorrent in Deno #16490

Closed
x7NFKCgJ opened this issue Oct 30, 2022 · 2 comments
Closed

Node Compat for WebTorrent in Deno #16490

x7NFKCgJ opened this issue Oct 30, 2022 · 2 comments
Labels
bug Something isn't working correctly node compat node native extension related to the node-api (.node)

Comments

@x7NFKCgJ
Copy link

Deno v1.27.0 on Ubuntu 22.04.1 LTS

I am trying to run WebTorrent in Deno using the following command:
deno run --allow-env --allow-ffi --allow-net --allow-read --allow-sys --unstable ./wt.js download 0E876CE2A1A504F849CA72A5E2BC07347B3BC957

Content of wt.js:
import "npm:webtorrent-cli/bin/cmd.js";

It produces the following error:
deno: symbol lookup error: /home/user/.cache/deno/npm/registry.npmjs.org/utp-native/2.5.3/prebuilds/linux-x64/node.napi.node: undefined symbol: uv_timer_init

uv_timer_init appears to be from libuv, which Node uses: https://docs.libuv.org/en/v1.x/timer.html

It works on the same system using Node. Is it currently possible to make this work with Deno?

@dsherret dsherret added bug Something isn't working correctly node compat node native extension related to the node-api (.node) labels Oct 31, 2022
@littledivy
Copy link
Member

littledivy commented Nov 1, 2022

libuv API won't work with Deno. libuv is Node.js' event loop implementation. Node-API already provides async_work and thread_safe_functions that work with Deno. I'd recommend creating an issue to remove libuv usage from webtorrent-cli.

@krishna-kush
Copy link

deno: symbol lookup error: /home/kay/Desktop/temp/ws/simple/node_modules/.deno/wrtc@0.4.7/node_modules/wrtc/build/Release/wrtc.node: undefined symbol: uv_is_closing

same error on wrtc module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat node native extension related to the node-api (.node)
Projects
None yet
Development

No branches or pull requests

4 participants