Skip to content

feat: add Astro 6 support to @keystatic/astro#1527

Open
fabian-von-tiedemann wants to merge 1 commit intoThinkmill:mainfrom
fabian-von-tiedemann:feat/astro-6-support
Open

feat: add Astro 6 support to @keystatic/astro#1527
fabian-von-tiedemann wants to merge 1 commit intoThinkmill:mainfrom
fabian-von-tiedemann:feat/astro-6-support

Conversation

@fabian-von-tiedemann
Copy link
Copy Markdown

Summary

Fixes #1515

Two minimal changes to support Astro 6:

  1. Bump peerDependencies — extend the astro range from "2 || 3 || 4 || 5" to "2 || 3 || 4 || 5 || 6" so package managers stop reporting unmet peer dependency warnings.

  2. Rename internal/keystatic-page.jskeystatic-page.tsx — In Astro 6's production SSR build pipeline, framework renderers are matched by file extension. Because keystatic-astro-page.astro imports from ./keystatic-page.js and uses client:only="react", Astro 6 throws:

    NoMatchingRenderer: Unable to render `Keystatic`.
    No valid renderer was found for the `.js` file extension.
    

    Renaming the file to .tsx lets Astro correctly identify it as a React component. The .astro import is updated accordingly (./keystatic-page.tsx).

    This issue does not surface in astro dev because Vite's dev server resolves modules more permissively than the production bundle — which is why it only affects deployed/production builds.

Testing

Verified fix matches the workaround confirmed working by community members in #1515 (Astro 6.1.2, @astrojs/netlify, production builds on Vercel/Netlify).

- Bump peerDependencies astro range from "2 || 3 || 4 || 5" to "2 || 3 || 4 || 5 || 6"
- Rename internal/keystatic-page.js → keystatic-page.tsx so Astro 6's
  SSR build pipeline correctly identifies the file as a React component.
  In production builds, Astro 6 matches framework renderers by file
  extension; a bare .js file triggers "NoMatchingRenderer" for
  client:only="react" components. Renaming to .tsx fixes this.

Fixes Thinkmill#1515
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 3, 2026

⚠️ No Changeset found

Latest commit: 4af56b0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Rishang
Copy link
Copy Markdown

Rishang commented Apr 6, 2026

+1

@enesismail
Copy link
Copy Markdown

Eagerly waiting for this. Thanks!

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.

Feature: Add Astro 6 support to @keystatic/astro

3 participants