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

Bettersqlite-3 doesnt work with Bun #2936

Open
felixrydberg opened this issue Dec 30, 2024 · 0 comments · May be fixed by #2944
Open

Bettersqlite-3 doesnt work with Bun #2936

felixrydberg opened this issue Dec 30, 2024 · 0 comments · May be fixed by #2944

Comments

@felixrydberg
Copy link

felixrydberg commented Dec 30, 2024

Environment


  • Operating System: Linux
  • Node Version: v22.12.0
  • Nuxt Version: ^3.13.0
  • CLI Version: 3.17.2
  • Nitro Version: -
  • Package Manager: [email protected]
  • Builder: -
  • User Config: default
  • Runtime Modules: @nuxtjs/tailwindcss@^6.12.1, @nuxtjs/i18n@^8.5.5, @pinia/nuxt@^0.5.4, @nuxt/content@^3.0.0-alpha.8, @nuxt/image@^1.8.1
  • Build Modules: -

Reproduction

Run Nuxt 3 with Content 3 with Bun instead of Node.

If installed with npm install instead of bun install installation will complete and allow the project to start with both npm run dev &bun run dev

Describe the bug

The better-sqlite3 dependency doesnt support Bun as a runtime, and from what I have found there arent any plans to support it since Bun has its own sqlite driver. There is an opened issue on bun's github page but I wanted to report it here aswell.

Additional context

I found this while looking around: https://db0.unjs.io/connectors/sqlite

Logs

➜  apollo git:(main) ✗ bun run dev
$ nuxt dev --port 3001
Nuxt 3.15.0 with Nitro 2.10.4                                                                                                                                                                                                                                              11:11:49 PM
                                                                                                                                                                                                                                                                           11:11:49 PM
  ➜ Local:    http://localhost:3001/
  ➜ Network:  use --host to expose

ℹ Using Tailwind CSS from ~/assets/css/tailwind.css                                                                                                                                                                                                      nuxt:tailwindcss 11:11:50 PM

 WARN  Locales en-US, es-ES, fr-FR, de-DE uses deprecated iso property, this will be replaced with language in v9                                                                                                                                                          11:11:50 PM


 ERROR  Cannot start nuxt:  Could not locate the bindings file. Tried:                                                                                                                                                                                                     11:11:50 PM
 → /node_modules/better-sqlite3/build/better_sqlite3.node
 → /node_modules/better-sqlite3/build/Debug/better_sqlite3.node
 → /node_modules/better-sqlite3/build/Release/better_sqlite3.node
 → /node_modules/better-sqlite3/out/Debug/better_sqlite3.node
 → /node_modules/better-sqlite3/Debug/better_sqlite3.node
 →/node_modules/better-sqlite3/out/Release/better_sqlite3.node
 → /node_modules/better-sqlite3/Release/better_sqlite3.node
 → /node_modules/better-sqlite3/build/default/better_sqlite3.node
 → /node_modules/better-sqlite3/compiled/22.6.0/linux/x64/better_sqlite3.node
 → /node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node
 → /node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node
 → /node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node
 → /node_modules/better-sqlite3/lib/binding/node-v127-linux-x64/better_sqlite3.node

    → node_modules/better-sqlite3/build/better_sqlite3.node
    → node_modules/better-sqlite3/build/Debug/better_sqlite3.node
    → node_modules/better-sqlite3/build/Release/better_sqlite3.node
    → node_modules/better-sqlite3/out/Debug/better_sqlite3.node
    → node_modules/better-sqlite3/Debug/better_sqlite3.node
    → node_modules/better-sqlite3/out/Release/better_sqlite3.node
    → node_modules/better-sqlite3/Release/better_sqlite3.node
    → node_modules/better-sqlite3/build/default/better_sqlite3.node
    → node_modules/better-sqlite3/compiled/22.6.0/linux/x64/better_sqlite3.node
    → node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node
    → node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node
    → node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node
    → node_modules/better-sqlite3/lib/binding/node-v127-linux-x64/better_sqlite3.node
    at bindings (node_modules/bindings/bindings.js:126:13)
    at new Database (node_modules/better-sqlite3/lib/database.js:48:29)
    at Database (node_modules/better-sqlite3/lib/database.js:11:14)
    at localDatabase (node_modules/@nuxt/content/dist/module.mjs:1670:40)
    at <anonymous> (node_modules/@nuxt/content/dist/module.mjs:1492:14)
    at startSocketServer (node_modules/@nuxt/content/dist/module.mjs:1491:34)
    at <anonymous> (node_modules/@nuxt/content/dist/module.mjs:2159:28)
    at processTicksAndRejections (native:7:39)


 ERROR  [unhandledRejection] Could not locate the bindings file. Tried:                                                                                                                                                                                                    11:11:50 PM
 → /node_modules/better-sqlite3/build/better_sqlite3.node
 → /node_modules/better-sqlite3/build/Debug/better_sqlite3.node
 → //node_modules/better-sqlite3/build/Release/better_sqlite3.node
 → /node_modules/better-sqlite3/out/Debug/better_sqlite3.node
 → /node_modules/better-sqlite3/Debug/better_sqlite3.node
 → /node_modules/better-sqlite3/out/Release/better_sqlite3.node
 → /node_modules/better-sqlite3/Release/better_sqlite3.node
 → /node_modules/better-sqlite3/build/default/better_sqlite3.node
 → /node_modules/better-sqlite3/compiled/22.6.0/linux/x64/better_sqlite3.node
 → /node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node
 → /node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node
 → /node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node
 → /node_modules/better-sqlite3/lib/binding/node-v127-linux-x64/better_sqlite3.node

    at bindings (node_modules/bindings/bindings.js:126:13)
    at new Database (node_modules/better-sqlite3/lib/database.js:48:29)
    at Database (node_modules/better-sqlite3/lib/database.js:11:14)
    at localDatabase (node_modules/@nuxt/content/dist/module.mjs:1670:40)
    at <anonymous> (node_modules/@nuxt/content/dist/module.mjs:2175:14)
    at processCollectionItems (node_modules/@nuxt/content/dist/module.mjs:2172:39)
    at <anonymous> (node_modules/@nuxt/content/dist/module.mjs:2139:33)
    at processTicksAndRejections (unknown:7:39)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant