-
-
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 DB build fails with Cloudflare adapter #10668
Comments
Running into this same issue. Appreciate the urgency! |
I'm not seeing the issue here. Will try on my Windows computer to make sure it's not specific to Windows. Could you try force reinstalling? Maybe something didn't get installed correctly. |
For myself I was able to successfully build and deploy once I drank more coffee and realized that I'm using the Cloudflare adapter, and followed the docs on Node compatability to enable the Node My config looks like this now:
|
@aklevecz Yeah the service is unfortunately not yet compatible with Cloudflare out of the box. Hoping to work with @alexanderniebuhr to fix that soon. |
@casungo are you also using Cloudflare adapter? |
yep, idk why the astro info didn't pick that up |
@matthewp yes, thank you so much! that works as a workaround |
Unfortunately I'm getting Subset of package.json
astro.config.mjs:
|
@serdar is this happening when you deploy to Cloudflare or developing locally? I got this error when I first deployed my app to Cloudflare, but it worked once I created a token in Astro Studio and set the https://docs.astro.build/en/recipes/studio/#create-a-studio-app-token |
@aklevecz no issues locally, only whilst running the deploy command ( I have the app token generated in Astro Studio and have the value set in the Environments tab in Cloudflare. |
@serdar oh I see, so you're building the project locally and then pushing it? I personally like connecting my Pages to Github and allowing my pushed commits to automatically trigger the build steps. But I am able to run
Does that work for you? Apologies if you had already tried that. |
Hey @aklevecz no need to apologize! I appreciate your contributions :) I'll try the Github route and see if that changes anything. But even running I reauth'ed the CLI and relinked the project (can see a
|
@matthewp Ohh.. that is new to me.. It was compatible with Cloudflare before. Did we change anything which introduced the use of |
@serdar IIRC you need to have the token during build and runtime. So you would need to set it as an environmental variable on the machine/CI you use to build and as a environmental variable in the Cloudflare Dashboard for all your environments. |
@alexanderniebuhr I have it already set in my |
Just to make sure, you did set them in the Cloudflare dashboard? |
Yep, 100%. BTW calls to Astro DB don't have the same issue when called from |
@matthewp very important detail, I think I saw a similar on Discord |
That could be me btw :) I'm raven! |
I'm also running into this issue with the Vercel Adapter, so I don't think it's cloudflare specific. It was introduced in |
@ElianCodes can you file a separate issue (or ping me on discord to debug)? Would like to keep this one cloudflare specific as it's likely coming from different causes. |
@alexanderniebuhr Started depending on |
I would separate both issues, since they are not the same. One is about Cloudflare support the other is that it seems there is a difference between Astro files and API Endpoints :) |
Talking over on discord it seems like removing the usage of |
Should be fixed with |
Appreciate all the effort going into this issue but still broken for me after updating to the latest version. Issuing
Astro versions:
ASTRO_STUDIO_APP_TOKEN set locally in |
for me the issue is fixed, the site builds fine without the vite external url config workaround, this is my astro info output:
|
Interesting, switching to hybrid works but I need to be using |
Everything works for me as well without using the vite external, and I use
|
@serdar have you tried adding it into your build command?
Not the sexiest solution, but I can't think of a more direct way to set an environment variable |
@aklevecz thank you! That worked, agreed not sexy, but gets me running for now :) I still can't pinpoint the problem, created a new project but with github actions for deployment and that worked without a problem. |
is it possible to access env vars from script? otherwise token gets exposed when commited to remote repo like github? |
I'm on a Macbook (M3) and have been unable to build since adding Astro DB. I've updated to 0.10.1 but still have the issue. I thought it was related to limited ulimit on macs but pushing to Vercel results in the same build failure. It looks like::
I have no data in the database other than a few seeded records for testing. They work great in local dev mode with no errors. |
@chadananda thanks for the update. I think the issue you face is different than the original one. The original one is related to the Cloudflare adapter, while the issue you explain look like being related to vercel. I always suggest to open a support thread on Discord first or open a new Issue on GitHub with all the informations for your project and include a minimal reproduction. |
@chadananda looks like Vercel can't find a webp file. Is there an image file you aren't committing to GitHub? |
i still get the error when using cloudflare |
@diogoribeirodev thank you for reporting that, can you please open a new issue with a minimal reproducible example which shows your setup and the error? |
Tried this but it doesn't work for me either. I keep getting this error: "Cannot create a remote client: missing app token." I'm using the cloudflare adapter with server mode, and I have the ASTRO_STUDIO_APP_TOKEN set in the Cloudflare dashboard as well as in my .env file. |
@YannisSefsaf Please open a new issue and provide a minimal reproduction, or explanation what steps you did after using |
setting my output to I had to add |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I am logged into Astro Studio, linked, and able to work with production data using the --remote flag in dev mode.
When attempting to build with the --remote flag, I get the following error:
What's the expected result?
astro build --remote
should build using the remote data.(forked the minimal reproducible example from #10617 since the issue is in the db integration)
(for the minimal reproducible example to work you would need to download the project, login, link and then execute a build with the remote flag)
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-6icpvd-oyrvsw
Participation
The text was updated successfully, but these errors were encountered: