withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
45.85k stars 2.41k forks source link

astrojs/db doesn't work on cloudflare pages #12019

Open zeshhaan opened 1 week ago

zeshhaan commented 1 week ago

Astro Info

$ astro info
Astro                    v5.0.0-beta.1
Node                     v20.10.0
System                   macOS (arm64)
Package Manager          bun
Output                   server
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/react
                         @astrojs/tailwind
                         astro:db

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

No response

Describe the Bug

@astrojs/db when used with libsql credentials doesn't work on cloudflare pages. it works fine on local but when accessing a page with astro db query on preview/production env, it breaks with 500. The console gives the following error message: LibsqlError: SERVER_ERROR: Server returned HTTP status 401

What's the expected result?

When interacting with Astro DB using libsql credentials in a Cloudflare deployed site, say for example, querying a db, we're expected to see it return a result. But instead, it breaks and returns 500 error.

Link to Minimal Reproducible Example

https://github.com/zeshhaan/error-astrodb-cf-repro

Participation

atej commented 3 days ago

Running into the same issue trying to use astro-db with Turso on a Cloudflare Pages deployment.