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

Deno panicked trying to run ZeroMQ from NPM package #18345

Open
welsonjr opened this issue Mar 22, 2023 · 3 comments
Open

Deno panicked trying to run ZeroMQ from NPM package #18345

welsonjr opened this issue Mar 22, 2023 · 3 comments
Labels
bug Something isn't working correctly node native extension related to the node-api (.node)

Comments

@welsonjr
Copy link

While trying to run the code bellow:

import zmq from "npm:zeromq@5"

async function run(): Promise<void> {
  const sock = new zmq.Pull

  sock.connect("tcp://127.0.0.1:3000")
  console.log("Worker connected to port 3000")

  for await (const [msg] of sock) {
    console.log("work: %s", msg.toString())
  }
}

run()

Deno panicked

Platform: macos x86_64
Version: 1.31.3
Args: ["deno", "run", "zmq-worker.ts"]

thread 'main' panicked at 'napi_register_module_v1 not found: DlSym { desc: "dlsym(0x7fc9dd4391d0, napi_register_module_v1): symbol not found" }', /private/tmp/deno-20230316-8411-14pm5ia/deno/ext/napi/lib.rs:707:14
stack backtrace:
0: 0x108dee56a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd84bb6a6cfdab3c7
1: 0x10834fc9a - core::fmt::write::h064e45b009bad019
2: 0x108dc976c - std::io::Write::write_fmt::h2baab28417cc385e
3: 0x108dee35a - std::sys_common::backtrace::print::h40507d34f683de75
4: 0x108dccd63 - std::panicking::default_hook::{{closure}}::h41d95177e478a814
5: 0x108dcca74 - std::panicking::default_hook::h92082f3783ffd863
6: 0x1082d6e24 - deno::setup_panic_hook::{{closure}}::hb16ad9950d35c310
7: 0x108dcd602 - std::panicking::rust_panic_with_hook::h7164f539cab4c561
8: 0x108dee9e5 - std::panicking::begin_panic_handler::{{closure}}::h0697ed62d1c15d34
9: 0x108dee948 - std::sys_common::backtrace::__rust_end_short_backtrace::h035e1452da26fb2c
10: 0x108dcd172 - _rust_begin_unwind
11: 0x10a2599c3 - core::panicking::panic_fmt::h619520ac8a6ef893
12: 0x10a259e25 - core::result::unwrap_failed::h5bb33123d8199612
13: 0x10888d983 - <extern "C" fn(A0) .> R as v8::support::CFnFrom>::mapping::c_fn::hd22173f4c0d0adf0
14: 0x1091d5e3f - __ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEENS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EEPmi
15: 0x1091d5435 - __ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE

@dsherret dsherret added bug Something isn't working correctly node native extension related to the node-api (.node) labels Mar 23, 2023
@bartlomieju
Copy link
Member

I just tried it with latest Deno and I get:

deno run -A foo.ts
error: Uncaught Error: No native build was found for platform=darwin arch=arm64 runtime=node abi=108 uv=1 armv=8 libc=glibc node=18.12.1
    loaded from: /Users/ib/dev/deno-parcel-bug/node_modules/.deno/[email protected]/node_modules/zeromq

    at Function.load.resolve.load.path (file:///Users/ib/dev/deno-parcel-bug/node_modules/.deno/[email protected]/node_modules/node-gyp-build/node-gyp-build.js:60:9)
    at load (file:///Users/ib/dev/deno-parcel-bug/node_modules/.deno/[email protected]/node_modules/node-gyp-build/node-gyp-build.js:22:30)
    at Object.<anonymous> (file:///Users/ib/dev/deno-parcel-bug/node_modules/.deno/[email protected]/node_modules/zeromq/binding.js:1:308)

Could you try it on your side @welsonjr and let me know if this is still a problem?

@welsonjr
Copy link
Author

Unfortunately the error still persists.

Platform: macos x86_64
Version: 1.34.0
Args: ["deno", "run", "-A", "zmq-worker.ts"]

thread 'main' panicked at 'napi_register_module_v1 not found: DlSym { desc: "dlsym(0x7f7f3e410020, napi_register_module_v1): symbol not found" }', /private/tmp/deno-20230525-9595-kb9wji/deno/ext/napi/lib.rs:667:14
stack backtrace:
   0:        0x1107fdd7a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h28eefff2fd6348c0
   1:        0x10fd669ea - core::fmt::write::h49021f0d249bdcdd
   2:        0x1107ee78c - std::io::Write::write_fmt::hfe905b75ea2975e8
   3:        0x1107fdb6a - std::sys_common::backtrace::print::h729e4781fcd708bf
   4:        0x1107e8d73 - std::panicking::default_hook::{{closure}}::he34a760df1040d15
   5:        0x1107e8a84 - std::panicking::default_hook::hc21c623951eeae76
   6:        0x110da1804 - deno::setup_panic_hook::{{closure}}::h7a849f342d0aa904
   7:        0x1107e974d - std::panicking::rust_panic_with_hook::hf3038b3a4cc27e74
   8:        0x1107fe0e5 - std::panicking::begin_panic_handler::{{closure}}::h167648f6debe79bf
   9:        0x1107fe049 - std::sys_common::backtrace::__rust_end_short_backtrace::h998cad6508c9fd44
  10:        0x1107e9182 - _rust_begin_unwind
  11:        0x111f7de53 - core::panicking::panic_fmt::h0c7b66c2bc0c7be6
  12:        0x111f7e2b5 - core::result::unwrap_failed::h534fb7147885e41d
  13:        0x1103cd338 - deno_napi::op_napi_open::v8_fn_ptr::h70c34adb0dec6503
  14:        0x110fd7e0e - __ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEENS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EEPmi
  15:        0x110fd7577 - __ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE

@anggoran
Copy link

I think this error is not caused by Deno. I tried to install in an Express project and got error too. It looks like zeromq.js has some bugs on the build and its dependencies:

I tried to use zeromq in Rust and Python and they requires no extra setup, while I think the Node library is different.

Actually, there is also a big news from the maintainer: zeromq/zeromq.js#576

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 native extension related to the node-api (.node)
Projects
None yet
Development

No branches or pull requests

4 participants