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

Error: Could not locate the bindings file (using bun) #1206

Closed
stabildev opened this issue Jun 23, 2024 · 3 comments
Closed

Error: Could not locate the bindings file (using bun) #1206

stabildev opened this issue Jun 23, 2024 · 3 comments

Comments

@stabildev
Copy link

Can't use better-sqlite3 with bun and drizzle-kit:

bunx drizzle-kit migrate and bunx drizzle-kit push produce the error Could not locate the bindings file.

Workaround for now (locally):

bun add -D node-gyp
cd node_modules/better-sqlite3
bun run build-release
cd -
@mceachen
Copy link
Member

mceachen commented Jun 23, 2024

I don't believe your workaround actually resolves the issue, though, at least using bun 1.1.16: I get a segfault on Windows and a symbol lookup error on Ubuntu after you force-rebuild the better-sqlite3 library and try to open a new db:

const bs = require("better-sqlite3")
const db = new bs("test.db")

I'd be surprised if bun played nicely with (any) non-FFI/node-gyp libraries, as we're interfacing with v8, and bun is JavaScriptCore-based, so the runtimes are completely different.

Have you considered https://bun.sh/docs/api/sqlite?

You could also try running with bun install --ignore-scripts, the workaround suggested here: oven-sh/bun#7598

More context: #1034 (comment)

@stabildev
Copy link
Author

stabildev commented Jun 23, 2024

I am using bun only as the package manager, not the runtime.

Why did you close this?

@mceachen

There are other issues in different contexts that all have a similar error message

@mceachen
Copy link
Member

You didn’t mention what runtime you’re using in the initial report, so I assumed bun.

This is arguably an install bug in bun (see the linked ticket).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants