Repository navigation
Description
What
Carry the astro-sst adapter into this repo as packages/astro-sst, published as @sst-community/astro-sst and installed under the old name, the same way as svelte-kit-sst:
npm install astro-sst@npm:@sst-community/astro-sst
Imports stay import aws from "astro-sst", and existing instructions keep working. One package for Astro 5, 6 and 7.
Why
sst.aws.Astro needs the astro-sst adapter, and its latest release (3.1.4, May 2025) is stuck on Astro 5:
- It doesn't build on Astro 7:
"applyPolyfills" is not exported by astro/app/node. - On Astro 6 and 7 it warns that
entrypointResolution: "explicit"is deprecated. - Astro 7's advanced routing (
src/fetch.ts) is ignored.astro-sstbuilds its app withnew NodeApp(manifest), and Astro only installssrc/fetch.tswhen the app comes fromcreateApp()inastro/app/entrypoint. - A route that only
fetch.tshandles gets a 404 even then, because the handler callsapp.match()first and returns its own 404 when no Astro route matches, beforeapp.render()runs.
Tested locally on Astro 7.3.5 with astro-sst 3.1.4, running the built handler with a fake API Gateway event. A patched copy (no applyPolyfills, entrypointResolution: "auto", createApp(), app.render() without the pre-check) served fetch.ts's header on /, served a fetch.ts-only route with 200, and still returned 404 for an unknown path. sst.aws.Astro read the Astro 7 build output fine. Not deployed, and only the buffered handler was tried.
Users impacted
Anyone on Astro 6 or 7 who deploys with SST, and anyone who wants Astro 7's advanced routing. What's open today:
- how to deploy astro v6? anomalyco/sst#6697 "how to deploy astro v6?" Open since 2026-04-07, 8 comments. SST said it would probably upgrade the adapter, then that it hoped to land an official AWS Astro provider, then (June) that it might do the upgrade itself. On 2026-06-23 a user wrote that Astro 7 is out and they're blocked.
- feat: support astro 6 anomalyco/astro-sst#27 "feat: support astro 6". Open since 2026-03-10, last updated 2026-09-21. By an Astro core maintainer. Moves to
createApp()andentrypointResolution: "auto", with separate buffer and stream entrypoints, for Astro 6+ only (drops Astro 5). Six comments from users asking for it to be merged, one saying it blocks their work and one asking for Astro 7 support (the PR's author replied that the next major should cover 6 and 7). One commenter also points to a libheif security advisory (GHSA-g89c-p67h-r497) as a reason to leave Astro 5; I haven't checked it. It keeps theapp.match()pre-check, so afetch.ts-only route would still 404. - how to deploy astro v6? anomalyco/astro-sst#28 "how to deploy astro v6?" Open since 2026-04-07; points at Bus: stop a stuck subscriber from freezing sst dev #27.
- Astro 5.7 Sessions API anomalyco/astro-sst#20 "Astro 5.7 Sessions API", open since 2025-04. Not part of this; noted for later.
- A question in the community Discord asking how to make Astro 7's advanced routing work with
astro-sst.
There is no open issue or PR about advanced routing itself.
In this repo, the examples aws-astro, aws-astro-stream, aws-astro-container and aws-astro-redis pin astro-sst 2.x (^2.41.2 or 2.43.5), older than the 3.1.2 that sst.aws.Astro already requires.
Plan
Mirrors packages/svelte-kit-sst (#6):
packages/astro-sst: the adapter fromanomalyco/astro-sst(MIT), with PR Bus: stop a stuck subscriber from freezing sst dev #27's changes as the base and its author credited as co-author.- Astro 6 and 7:
entrypointResolution: "auto",createApp(), separate buffer and stream entrypoints. - Astro 5: keep the current
NodeApppath, chosen by feature detection like the SvelteKit adapter does (nocreateAppin Astro 5). NoapplyPolyfills. - Render through
app.render()without a match-first 404, keeping the404.htmland/404fallbacks, sosrc/fetch.tsworks.
- Astro 6 and 7:
- Tests, like
svelte-kit-sst's: build Astro 5, 6 and 7 apps with the adapter, bundle the handler as SST does, call it with Lambda events (buffer and stream). Cases: pages, 404, cookies (multipleset-cookie), POST body, binary, redirects, prerendered pages,src/fetch.tson Astro 7. - CI:
.github/workflows/astro-sst.yml, likesvelte-kit-sst.yml. - README and CHANGELOG with the alias install; build on
prepack;publishConfig.access: public. - Wiring in the rest of the repo:
pkg/global/distribution.go: addastro-ssttoCommunityPackages, sosst initinstalls it under the old name.platform/templates/astro/preset.json,www/.../start/aws/astro.mdx, README: the install command and the Astro 6/7 notes.platform/src/components/aws/astro.ts: the version check and error text (it requiresastro-sst3.1.2 or later; the new package's version must pass it).- Examples: move the four above to the alias.
Still to decide
- The version number for the first release.
svelte-kit-sststarted at 3.0.0. - Whether to keep supporting Astro 5 (the plan above does, since
sst.aws.Astrousers may still be on it).
Activity
the-human-mustachio commentedon Oct 7, 2026
Here's the plan. We'll build it on the
astro-sstbranch and open a PR from it. Comments on the approach are welcome before then.The package
@sst-community/astro-sst4.0.0 lives inpackages/astro-sstand is released the same way as@sst-community/svelte-kit-sst. One version supports Astro 5, 6 and 7.The adapter
createAppfromastro/app/entrypointandentrypointResolution: "auto", for both the buffered and the streaming handler.applyPolyfillsincluded. Astro 5 has noastro/app/entrypoint, and Bus: stop a stuck subscriber from freezing sst dev #27 drops Astro 5 on purpose. The adapter picks the path when the app is built, from the installedastro/package.json. The current adapter also breaks on recent Astro 6: 6.4.8 and 7 no longer exportapplyPolyfills.app.match()check before rendering goes. The adapter callsapp.render()and passesprerenderedErrorPageFetch, which returns the bundled404.html. That way Astro decides when a 404 applies, and routes that onlysrc/fetch.tshandles work. Astro 5, 6 and 7 all have the option.serverEntrypointbecomes aURLto the adapter's file instead of the package name. That works whether the app installs the package under the aliasastro-sst(whatsst initwrites) or as@sst-community/astro-sst.What
sst.aws.Astroreads, which stays the samedist/server/entry.mjsexportshandler.404.htmlstays in the server output folder, because the component copies it into the function.sst.buildMeta.jsonkeeps its fields. The component requirespluginVersion3.1.2 or higher, which is why this is 4.0.0. Upstream's next release from Bus: stop a stuck subscriber from freezing sst dev #27 would also be 4.0.0, so our changelog will say ours supports Astro 5 to 7.Astro 6 and 7 need Node 22.12 or newer. Sites default to
nodejs24.x, so this only affects a site that sets an older runtime. The docs will say so.Wiring
release.ymlloops over every package inpackages/, and publishes any version that isn't on npm yet.CommunityPackagesmapsastro-sstto@sst-community/astro-sst, sosst initinstalls ours.Testing and release
sst.aws.Astro.sst initfails for every Astro app. After that,release.ymlpublishes new versions through npm trusted publishing.