-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Astro is unable to use the bun:sqlite
package.
#8476
Comments
Astro is a Node framework. If something specific to another runtime doesn't work, not only I don't know what we could do about it, but also, it's unrelated to us. I'd recommend raising the issue over to the people at Bun. |
I hate saying this but This appears to be a bug in Astro. Astro's module resolution prevents bun builtin modules from being used. Astro resolves modules before Bun's module resolution runs. Bun cannot fix this without overriding Astro's module resolution altogether, which would break Astro on Bun in other ways and is generally not something you want. You can fix this by marking |
I would assume that this affect every Vite SSR app then, doesn't it? |
I just tried @Jarred-Sumner's suggestion, without luck. And yes @Princesseuh, I would assume this affects any Vite SSR app. I couldn't even get the dev-server running without adding "bun:sqlite" to the I kept getting this:
In Vite's async function nodeImport(
id: string,
importer: string,
resolveOptions: InternalResolveOptionsWithOverrideConditions,
) {
let url: string
/* WE NEED TO ADD BUN HERE */
if (id.startsWith('node:') || id.startsWith('data:') || isBuiltin(id)) {
url = id
} else {
// Internal Vite resolution stuff. Uses node-resolve Rollup plugin.
} In other words, this needs to be fixed in Vite, not Astro. I'd love to raise the issue, but I'm not familiar with the SSR API in Vite in order to reproduce it there. |
It appears the Vite use case is handled by Bun. By adding
Here the info from the doc: https://bun.sh/guides/ecosystem/vite |
Feel free to open an issue in Vite regarding this. I think that line should indeed fix it, but Vite probably needs a more standardized flow internally for handling different runtime builtin protocols. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Astro is unable to use the
bun:sqlite
package.Error:
What's the expected result?
The
bun:sqlite
can be imported and used.Link to Minimal Reproducible Example
https://github.com/homelyseven250/astro-bun-bug
Participation
The text was updated successfully, but these errors were encountered: