Skip to content

fix(astro): require Astro 6 peer dep (>=6 <7)#429

Merged
MajorTal merged 1 commit into
mainfrom
claude/sad-swanson-696e6c
Jun 4, 2026
Merged

fix(astro): require Astro 6 peer dep (>=6 <7)#429
MajorTal merged 1 commit into
mainfrom
claude/sad-swanson-696e6c

Conversation

@MajorTal
Copy link
Copy Markdown
Collaborator

@MajorTal MajorTal commented Jun 4, 2026

Problem

@run402/astro's SSR runtime (astro/src/runtime/server.ts) does await import("astro/app/entrypoint") — an Astro-6-only export. Registry-confirmed: astro@5.18.2 exports only ./app and ./app/node; ./app/entrypoint first appears in Astro 6.

But peerDependencies.astro was >=5 <7. A consumer on Astro 5 using the default export default run402() preset (or createRun402Adapter()) therefore aborted during astro build's "Building server entrypoints" step with the opaque:

[commonjs--resolver] Missing "./app/entrypoint" specifier in "astro" package

The try/catch in getAstroApp() doesn't help — Vite resolves the specifier at bundle time, before the runtime guard runs.

Fix

Tighten the peer range to >=6 <7 so the declared support matches what the SSR adapter actually requires — npm now warns at install time instead of crashing mid-build.

The build-time image integration (run402Image() / the named run402 alias, used without the SSR adapter) never bundles runtime/server.ts and still runs on Astro 5, but Astro 5 is now outside the supported peer range.

Verification

build:core + build:sdktsc --noEmit -p astro ✅ → npm test --workspace=astro (285 pass, 0 fail) ✅ → npm run build --workspace=astro ✅.

Notes

  • This fixes the repo; consumers only get it after a new @run402/astro is published (separate, authorized step — not done here).
  • Sibling private-repo drift (the packages/astro/ copy + the live run402.com/errors/ page still advising "pin Astro ^5") is tracked in kychee-com/run402-private#469.

🤖 Generated with Claude Code

The SSR runtime (astro/src/runtime/server.ts) imports astro/app/entrypoint,
an Astro-6-only export (Astro 5 exports only ./app and ./app/node). The
>=5 <7 peer range therefore caused a cryptic build crash on Astro 5 during
"Building server entrypoints":

  [commonjs--resolver] Missing "./app/entrypoint" specifier in "astro" package

The try/catch in getAstroApp() can't help — Vite resolves the specifier at
bundle time, before the runtime guard runs. Tighten the peer range to >=6 <7
so it matches what the SSR adapter actually requires (npm warns at install
instead of crashing mid-build). Reconcile the lockfile and update the README
install note + CHANGELOG.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MajorTal MajorTal merged commit 73ef3fd into main Jun 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant