Closed jkhaui closed 2 days ago
Are you using the latest version of @astrojs/cloudflare
? It should be fixed now. There was an unintended breaking change that required installing the latest version of Astro as well (which you could also do to workaround the problem if you can't upgrade @astrojs/cloudflare
)
Are you using the latest version of
@astrojs/cloudflare
? It should be fixed now. There was an unintended breaking change that required installing the latest version of Astro as well (which you could also do to workaround the problem if you can't upgrade@astrojs/cloudflare
)
Hey Bjorn, appreciate the quick reply. Yep I am using the latest cloudflare adapter & astro versions (11.0.1 & 4.11.1 respectively)
Oh and another thing I realised - for my project, bumping the cloudflare adapter version to 11+ completely breaks my prod build (after I replace all the env vars with hardcoded strings to unblock myself on the issue opened here).
Below you can see the background gradient on the body being rendered, but none of the islands (or even static HTML components for that matter) render:
Interesting how the browser console is also free of error messages. I'm pretty certain it's the major version bump for the CF adapter causing this as I push regularly (daily) and only finding these problems now. And updating to the latest Astro version in isolation doesn't break anything
I'll check the CF server logs and update if I find any important info, just let me know if I can provide anything else that will help you - cheers
update: Ok, confirming a couple of findings:
@astrojs/cloudflare 10.4.2
completely resolves this rendering issueFor now I will use these workarounds and avoid using v11+ of the adapter so hopefully you have more time to rectify the root cause
Since this is related to @astrojs/cloudflare
, I'll move this over to the adapter repo. However, it would be great if you can provide a repro, or perhaps @alexanderniebuhr has a hint of the issue.
I wish I could help on that one for astro:env
but i know very little about how cloudflare works so i'll wait for Alex's opinion first
@jkhaui can you provide a reproduction? You can also provide your project, so I can take a look to see if that is enough.
Happy to reopen this issue, when a reproduction is provided.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Hi,
I saw the cloudflare adapter had a major update, so I read the changelog and noticed there appears to be a push to use the experimental env vars option. So I've followed the instructions and my dev environment works fine.
But when deploying to CF, I get the following error about rollup failing to resolve
astro:env/client
:Then, I follow the workaround to externalise it, and now I get this error:
No idea what to do - is this a Cloudflare issue, an actual bug, or am I just overlooking something really obvious? Btw, I know the Astro team is great and works hard to support many runtimes, use-cases, etc. but boy I've probably spent more time trying to get project configuration & environment variables working in dev vs. prod than actually developing my app
What's the expected result?
Env vars should work in production
Sorry for not providing a proper repo, it's just not feasible considering we're dealing with a CF build pipeline issue
Link to Minimal Reproducible Example
https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics?file=README.md
Participation