You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
browser, for the client component (client:only="react")
if cloudflare preset is not used, server routes will be missing dependencies.
if cloudflare preset is used, it can build but as astro bundle react & dependencies in chunk, client component will get errors like "process is not defined" as it try to run the cloudflare shim versions too
The text was updated successfully, but these errors were encountered:
Background
Astro supports cloudflare page deployment
However it turns out it is very ticky to handle dependency properly for ssr site
https://developers.cloudflare.com/pages/framework-guides/deploy-an-astro-site/
Sample Setup
nodejs_compat
https://developers.cloudflare.com/workers/runtime-apis/nodejs/Analysis
unenv
inside astro config and setup cloudflare presetunenv cloudflare preset evolved quite a bit since v1.10.0 release (https://github.com/unjs/unenv/tree/main). Use git to resolve for latest branch
config has to run in 3 runtimes
if cloudflare preset is not used, server routes will be missing dependencies.
if cloudflare preset is used, it can build but as astro bundle react & dependencies in chunk, client component will get errors like "process is not defined" as it try to run the cloudflare shim versions too
The text was updated successfully, but these errors were encountered: