Skip to content

Instantly share code, notes, and snippets.

@schickling
Created October 23, 2025 09:38
Show Gist options
  • Save schickling/72f93719b32a23572f2b325cc520f370 to your computer and use it in GitHub Desktop.
Save schickling/72f93719b32a23572f2b325cc520f370 to your computer and use it in GitHub Desktop.
Netlify + Astro: Limitations and Suggestions

Netlify + Astro: Limitations and Suggestions

  • Edge bundling (Astro + Netlify adapter)

    • Limitation: astro build does not emit the final .netlify/edge-functions-dist bundle; only the Netlify build phase produces it. This makes “prebuild + deploy --no-build” unreliable for attaching Edge Functions.
    • Suggestion: Provide a documented, supported way to generate the edge bundle alongside astro build (or an explicit netlify edge:bundle/edge:deploy that attaches prebuilt bundles without a full build).
  • Deploy CLI outputs (permalink vs deploy URL)

    • Limitation: netlify deploy --json consistently returns the per‑deploy URL (e.g. https://<id>--<site>.netlify.app) but not a stable permalink/primary domain URL. The url field is inconsistent and not documented as canonical.
    • Suggestion: Always include canonical site/permalink URLs in the JSON result, and document the fields clearly (e.g. primary_url, alias_url).
  • Monorepo path resolution

    • Limitation: CLI “Resolved config” often anchors to the Git toplevel, which can ignore app‑local netlify.toml intentions and make edge attachment brittle.
    • Suggestions: Honor NETLIFY_CONFIG/cwd more strongly for determining app root; emit a machine‑readable “resolved app root/publish” in --json output; add monorepo best‑practices to docs.
  • Attaching edges without a full build

    • Limitation: Even when an edge bundle exists, there is no documented way to “attach” it during deploy --no-build reliably.
    • Suggestion: Provide a CLI/API to attach an existing .netlify/edge-functions-dist to a deploy (e.g. netlify edge:attach --bundle <dir>), or guarantee that config‑driven deploy registers edges when a valid bundle is present.
  • Machine‑readable logs

    • Limitation: With --debug, human logs are mixed into --json output, breaking JSON parsing.
    • Suggestion: Keep --json output clean (all debug to stderr), or add a --json-verbose mode that emits structured diagnostics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment