-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Module build failed: UnhandledSchemeError: Reading from "bun:sqlite" is not handled by plugins (Unhandled scheme). #4350
Comments
I ran into this issue and I made https://www.npmjs.com/package/@hebilicious/libsql-client while working on tursodatabase/libsql-client-ts#71 This works with drizzle : import { drizzle } from "drizzle-orm/libsql"
import { createClient } from "@hebilicious/libsql-client"
const url = process.env.DATABASE_URL ?? "file:drizzle/local.db"
const authToken = process.env.DATABASE_AUTH_TOKEN
console.log(`Connecting to ${url}...`)
export const client = createClient({ url, authToken })
export const db = drizzle(client) |
Are you bundling with |
related thread in webpack repo webpack/webpack#12792 |
To use bun:sqlite with webpack, bun:sqlite needs to be marked as external. Similar to how there is a node externals webpack plugin, there needs to be a bun externals webpack plugin. |
I see, got it. Tried to update
It worked in
force running build in bun with
seems related to this #4795 |
Then, use |
This would be a bug in webpack/webpack config and not quite in Bun, though a "next-plugin-bun" would be a good solution for next for this @gandli's solution should help |
for anyone having issue, update the |
What version of Bun is running?
0.8.1
What platform is your computer?
Darwin 23.0.0 arm64 arm
What steps can reproduce the bug?
Try
drizzle-orm
withbun:sqlite
exampleReference: https://orm.drizzle.team/docs/installation-and-db-connection/sqlite/bun
What is the expected behavior?
It should run like we run normal sqlite, but blazingly fast 🔥 ⚡
What do you see instead?
Additional information
Environment:
The text was updated successfully, but these errors were encountered: