bun
bun copied to clipboard
dyld[30845]: missing symbol called / undefined symbol: uv_mutex_lock
What version of Bun is running?
1.0.6
What platform is your computer?
Darwin 22.5.0 arm64 arm
What steps can reproduce the bug?
Install Couchbase Server / Couchbase Capella Cloud -> docker run -t --name db -p 8091-8096:8091-8096 -p 11210-11211:11210-11211 couchbase/server:enterprise-7.2.0 or https://cloud.couchbase.com/ Install Couchbase SDK -> bun add [email protected] Run Bun -> bun index.js
index.js
const couchbase = require('couchbase')
async function main() {
const cluster = await couchbase.connect(
'couchbase://127.0.0.1',
{
username: 'username',
password: 'password',
})
const bucket = cluster.bucket('default')
const coll = bucket.defaultCollection()
await coll.upsert('testdoc', { foo: 'bar' })
const res = await coll.get('testdoc')
console.log(res.content)
}
// Run the main function
main()
.then((_) => {
console.log ('Success!')
})
.catch((err) => {
console.log('ERR:', err)
})
Reference: https://docs.couchbase.com/nodejs-sdk/current/hello-world/start-using-sdk.html
What is the expected behavior?
Runs and connects to a Couchbase Instance
What do you see instead?
bun add [email protected]
bun run index.js
121 | throw e;
122 | }
123 | }
124 | }
125 |
126 | err = new Error(
^
error: Could not locate the bindings file. Tried:
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/build/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/build/Debug/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/build/Release/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/out/Debug/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/Debug/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/out/Release/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/Release/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/build/default/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/compiled/20.8.0/darwin/arm64/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/addon-build/release/install-root/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/addon-build/debug/install-root/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/addon-build/default/install-root/couchbase_impl.node
→ /Users/me/Documents/bun-couchbase/node_modules/couchbase/lib/binding/node-v115-darwin-arm64/couchbase_impl.node
at bindings (/Users/me/Documents/bun-couchbase/node_modules/bindings/bindings.js:126:8)
at /Users/me/Documents/bun-couchbase/node_modules/couchbase/dist/binding.js:160:6
at globalThis (/Users/me/Documents/bun-couchbase/node_modules/couchbase/dist/binding.js:161:18)
at overridableRequire (:1:20)
at /Users/me/Documents/bun-couchbase/node_modules/couchbase/dist/couchbase.js:21:18
at globalThis (/Users/me/Documents/bun-couchbase/node_modules/couchbase/dist/couchbase.js:81:44)
at overridableRequire (:1:20)
at /Users/me/Documents/bun-couchbase/index.js:1:6
at globalThis (/Users/me/Documents/bun-couchbase/index.js:29:28)
bun add [email protected]
dyld[30845]: missing symbol called
zsh: killed bun run index.js
npm i couchbase [email protected]
233 | target.push(`libc=${libc}`)
234 | }
235 | if (typeof __webpack_require__ === 'function') {
236 | target.push('webpack=true')
237 | }
238 | throw new Error(
^
error: Could not find native build for platform=darwin, arch=arm64, runtime=node, nodeVersion=20.8.0, sslType=openssl3 loaded from /Users/me/Documents/bun-couchbase/node_modules/couchbase.
at resolvePrebuild (/Users/me/Documents/bun-couchbase/node_modules/couchbase/scripts/prebuilds.js:238:8)
at loadPrebuild (/Users/me/Documents/bun-couchbase/node_modules/couchbase/scripts/prebuilds.js:119:24)
at /Users/me/Documents/bun-couchbase/node_modules/couchbase/dist/binding.js:158:6
at globalThis (/Users/me/Documents/bun-couchbase/node_modules/couchbase/dist/binding.js:159:18)
at overridableRequire (:1:20)
at /Users/me/Documents/bun-couchbase/node_modules/couchbase/dist/couchbase.js:21:18
at globalThis (/Users/me/Documents/bun-couchbase/node_modules/couchbase/dist/couchbase.js:102:44)
at overridableRequire (:1:20)
Additional information
No response
Possibly related to #4959
@Electroid How would i be able to verify? The trustedDependancies approach doesn't work.
@Electroid Maybe I can reach out to couchbase ?
This is very likely a bug in Bun, not couchbase. We will fix it.
Same happening with libxmljs. The library needs to run compilation scripts so it's added to trustedDependencies
, however, after installation, when running any file with bun /path/to/file.ts
that imports and uses libxmljs
, I get:
dyld[<process number>]: missing symbol called
[1] <process number> killed bun ./bin/file.ts
Runs fine on ts-node
Same happening with libxmljs. The library needs to run compilation scripts so it's added to
trustedDependencies
, however, after installation, when running any file withbun /path/to/file.ts
that imports and useslibxmljs
, I get:dyld[<process number>]: missing symbol called [1] <process number> killed bun ./bin/file.ts
Runs fine on
ts-node
Yeah along the same lines
Any progress / ETA on this ? Been wanting to use Bun for some projects but at this point if this is abandoned, would like to know
Seeing the same thing when trying to use robotjs after getting it to build by installing node-gyp
and adding robotjs
to the trustedDependencies
Same thing happens in bun 1.0.18 on macos arm64 if I do require('@sap/hana-client')
. The package was installed with pnpm and comes with prebuilt binaries (no postinstall step).
SAP and Couchbase are two enterprise solution together with OpenTelemetry that we use in our corporation. This to me makes Bun not production ready.
If my understanding is correct, it is not the specific compatibility with CouchBase, SAP or libxmljs that has to be looked into, but rather that these packages rely on some modules for which Bun does not yet offer compatibility.
They must be yellow or red modules of this list.
We need to find a quick way to determine which of these modules is the culprit. Maybe we will find out the underlying issue is all about the same module for all of the above mentioned packages, so we can ask to prioritise its implementation for next releases. I would love to help myself for the implementation of these but my Zig skills are not yet up to speed for it.
SAP and Couchbase are two enterprise solution together with OpenTelemetry that we use in our corporation.
For telemetry we're using dynatrace
like most SAP products, it used to crash at import when bun
1.0.0 was launched, now it's no longer crashing (at least at import, haven't tried anything more than that). But yeah, as an alternative, support for any other OpenTelemetry-compatible framework would be great to have.
For @sap/hana-client
, there is a pure-JS client called hdb
, but it's quite buggy with certain data types even on nodejs, so the NAPI client would be great to have.
BTW, on Linux x64 the error is more explicit (using [email protected]
):
TypeError: <repo>/node_modules/.pnpm/@[email protected]/node_modules/@sap/hana-client/prebuilt/linuxx86_64-gcc6/hana-client.node: undefined symbol: uv_mutex_lock
@Electroid @Jarred-Sumner
Any timelines for when this will be looked into or completed, it seems every other NPM compatibility issue is being looked into and resolved, even when logged after this.
This same issue seems to happen when importing any version of pdfjs-dist
. Which is the prebuilt version of this.
Issue also arrising with node-snap7
Waiting for this to ditch node... this and http2 for gRPC
@Electroid @Jarred-Sumner
We were excited for Bun, eagerly anticipating starting new projects with Bun, which means delaying or holding development to really give us time to implement & test before fully committing.
Would help to know if this is feasible & timelines or just to abandon this endeavour. Do you need any help ?
the same with subset-iconfont
package
import { MiProvider } from 'subset-iconfont';
const mdi = new MiProvider(['shopping-cart', "shopping-cart-checkout", "delete"], {
formats: ['woff2'],
generateMinCss: false,
generateCssMap: false,
writeOutFiles: ['web', 'webfonts',"metadata"]
});
mdi.makeFonts('./outputDir').then((result) => {
console.log('Done!');
});
new discovery: This error can also occur in ssh2
import 'ssh2'
console.log('ssh2')
// const ssh2 = new Client()
// ssh2.on('ready', () => {
// console.log('Client :: ready')
// ssh2.end()
// })
$ bun run test.ts
dyld[7636]: missing symbol called
Same in tree-sitter
Same with Konva;
missing symbol called can mean any missing symbol, but the uv_mutex_t
apis (mentioned at one point in this thread) should not be hard to implement (bun does not use libuv on posix platforms)
@Electroid @Jarred-Sumner @paperdave Thanks for the insight, got it working and now testing... hopefully should be able to close this.
Running brew install --HEAD libuv Removing bun.lock & node_modules Bun Update (with couchbase still in trusted dependencies)
Got a Post install message
Same on node-ssh
This same issue seems to happen when importing any version of
pdfjs-dist
. Which is the prebuilt version of this.
Check https://github.com/oven-sh/bun/issues/6608#issuecomment-2008316410, solved it by doing some manual module overriding shenanigans
Figure out the needed dependancies required for postinstall
Running brew install --HEAD libuv Removing bun.lock & node_modules Bun Update (with couchbase still in trusted dependencies)
While that is a workaround, we do want to have a proper fix.
frida same
the proposed workaround didn't work for me with Bun v1.1.8 on Linux or Mac. trying to use zeromq library
bun: symbol lookup error: /node_modules/zeromq/prebuilds/linux-x64/node.napi.glibc.node: undefined symbol: uv_async_init
I can't wait until this is fixed 🤞 - It's the last blocker for my ditching Node + Express + Socket.io