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

bun:sqlite - ESM loader error. Received protocol 'bun:' #8481

Closed
1 task
fabriziogiordano opened this issue Sep 10, 2023 · 2 comments
Closed
1 task

bun:sqlite - ESM loader error. Received protocol 'bun:' #8481

fabriziogiordano opened this issue Sep 10, 2023 · 2 comments
Labels
needs triage Issue needs to be triaged

Comments

@fabriziogiordano
Copy link

Astro Info

Astro                    v3.0.12
Node                     v18.17.1
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I am using Bun JS to build Astro. I also use SQLite to store some content.
When I use bun:sqlite to read the db I get an error during both dev and build.

This is the error I received in dev:

# bun run dev                 
$ astro dev
  🚀  astro  v3.0.12 started in 202ms
  
  ┃ Local    http://localhost:4000/
  ┃ Network  use --host to expose
  
Error: The following dependencies are imported but could not be resolved:

  bun:sqlite (imported by /root/astro-bun-sqlite/src/libs/db.ts)

Are they installed?
    at file:///root/astro-bun-sqlite/node_modules/vite/dist/node/chunks/dep-df561101.js:45705:23
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///root/astro-bun-sqlite/node_modules/vite/dist/node/chunks/dep-df561101.js:45114:38

Ref: oven-sh/bun#4761

What's the expected result?

bun:sqlite is supported

Link to Minimal Reproducible Example

https:/fabriziogiordano/astro-bun-sqlite

Participation

  • I am willing to submit a pull request for this issue.
@xiBread
Copy link
Contributor

xiBread commented Sep 10, 2023

Duplicate of #8476

@Princesseuh Princesseuh closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2023
@fabriziogiordano
Copy link
Author

It appears the Vite use case is handled by Bun.

By adding --bun: The --bun flag tells Bun to run Vite's CLI using bun instead of node.

bun --bun run astro build

Here the info from the doc: https://bun.sh/guides/ecosystem/vite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants