-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
astrojs/db doesn't work on cloudflare pages #12019
Comments
astrojs/db
with libsql connection fails on production
Running into the same issue trying to use |
Is anyone able to provide better logs here? |
there was a discussion in a related thread on discord with folks sharing the logs (if that might help) |
Same issue, I'm getting: {
"code": "SERVER_ERROR",
"name": "LibsqlError"
} Works fine locally (and astro dev --remote). Don't work when on cloudflare workers environment, i.e. wrangler dev or deployed to cloudflare pages. Also, |
Hello! Looks like the issue is to do with how the database variable is instantiated. Stack traces aren't entirely useful since it's all compiled and random looking but through some thorough sniffing around I found out that:
So, in summary, Workers only exposes environment variables per I'd love to contribute to fix this if anyone can point me in the right direction. |
Not sure about the worker runtime, but I just hit a similar issue because I was on Node 20 and support for |
Astro Info
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
The text was updated successfully, but these errors were encountered: