bun
bun copied to clipboard
zeromq module not working
What version of Bun is running?
1.0.26
What platform is your computer?
Darwin 22.6.0 arm64 arm
What steps can reproduce the bug?
bun init
bun add zeromq
echo "require('zeromq')" > index.ts
bun index.ts
What is the expected behavior?
Expecting zeromq
module to load (and no output).
What do you see instead?
dyld[19197]: missing symbol called
zsh: killed bun index.ts
Additional information
Works in node (v21). This appears to be a regression as the same issue was marked closed in #6313
~/code/rs/rtfd/bunbug ❯ node
Welcome to Node.js v21.6.1.
Type ".help" for more information.
> require("zeromq");
{
capability: [Getter],
context: [Getter],
curveKeyPair: [Getter],
version: [Getter],
Context: [Getter],
Socket: [Getter],
Observer: [Getter],
Proxy: [Getter],
Pair: [class Pair extends Socket],
Publisher: [class Publisher extends Socket],
Subscriber: [class Subscriber extends Socket],
Request: [class Request extends Socket],
Reply: [class Reply extends Socket],
Dealer: [class Dealer extends Socket],
Router: [class Router extends Socket],
Pull: [class Pull extends Socket],
Push: [class Push extends Socket],
XPublisher: [class XPublisher extends Socket],
XSubscriber: [class XSubscriber extends Socket],
Stream: [class Stream extends Socket]
}
>
Also tested with bun v1.0.17 (went back to binary chop to a version that works, but no luck yet).
Can confirm this is still an issue.
bun -v 1.0.25
"zeromq": "6.0.0-beta.19"
dyld[28564]: missing symbol called
[1] 28564 killed bun run index.ts
I have a minimal bug reproduction repo here: https://github.com/nk1tz/bun-zeromq-bug-repro which also includes a macOS crash report.
I also included a docker-compose
way of running which has a different failure mode (I don't know if related) in case that's helpful.
The zeromq install script appears to run successfully during bun i --verbose
, I don't see any obvious errors there.
~seems to work after bun upgrade --canary
~
my bad, can install on canary but it doesn't work at runtime
~seems to work after
bun upgrade --canary
~my bad, can install on canary but it doesn't work at runtime
Correct, this is a runtime error.
bun i [email protected] --verbose
shows a successful run of zeromq's post-install script.
Just tested on bun 1.0.30
Confirmed still a bug.
Definitely still broken as of 1.1.12 albeit with a very slightly different error, is this likely to get resolved any time soon or should we be looking for another way forward?
dyld[66065]: missing symbol called
[1] 66065 abort bun run test.ts
@alexgraul its the same error
The issue is that zeromq uses V8 or libuv symbols which we haven't implemented yet. The tracking issue for this is #4290
Understood, thankyou for the tracking issue link!
I notice that zeromq has an implementation in zig.
Would this be at all useful as a way to support zeromq in bun?
Would this be at all useful as a way to support zeromq in bun?
You may be interested in tr1ckydev/hyperimport: ⚡ Import c, rust, zig etc. files in your TypeScript code and more. which allows you to import { add } from "./add.zig";
We are tracking this in #4290
Please follow along there