Skip to content

Fix Vue render-function components crashing when @astrojs/react is enabled - #17985

Merged
matthewp merged 1 commit into
mainfrom
factory/fix-17983
Sep 14, 2026
Merged

matthewp merged 1 commit into
mainfrom
factory/fix-17983

Conversation

@astro-factory

@astro-factory astro-factory Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Vue render-function components (script-only .vue SFCs and .js files using defineComponent()) no longer crash during astro build when @astrojs/react is also enabled. Previously, React's renderer check accessed Component['$$typeof'].toString() without a null guard, throwing a TypeError on any object component that lacks $$typeof (such as Vue defineComponent() results).
  • Adds optional chaining (?.) to React's check so it returns false instead of crashing when $$typeof is absent, and extends Vue's check to also recognize components that expose a setup function but no ssrRender / __ssrInlineRender property (i.e. render-function-only components not compiled from a <template> block).

Testing

  • Adds packages/integrations/vue/test/multi-renderer.test.ts covering render-function .vue SFCs and .js defineComponent() components in a multi-framework project that includes the React integration, asserting they build and server-render correctly without throwing.

Docs

  • No docs update needed; this is a bug fix restoring behavior that should have worked all along.

Closes #17983

…ith React integration

React's `check` function crashed on non-React object components by accessing
`Component['$$typeof'].toString()` without a null guard. Added optional chaining
so it returns `false` instead of throwing.

Vue's `check` function only recognized template-compiled SFCs (via `ssrRender` /
`__ssrInlineRender`). Extended it to also match `defineComponent()` components
that have a `setup` function, covering render-function-only SFCs and JS modules.

Fixes #17983
@astro-factory astro-factory Bot added the fix verified Reporter confirmed the triage bot fix works label Sep 12, 2026
@changeset-bot

changeset-bot Bot commented Sep 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 238279d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions Bot added pkg: vue Related to Vue (scope) pkg: react Related to React (scope) pkg: integration Related to any renderer integration (scope) labels Sep 12, 2026
@matthewp
matthewp merged commit 7a6e7f7 into main Sep 14, 2026
28 checks passed
@matthewp
matthewp deleted the factory/fix-17983 branch September 14, 2026 23:15
@astrobot-houston astrobot-houston mentioned this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix verified Reporter confirmed the triage bot fix works pkg: integration Related to any renderer integration (scope) pkg: react Related to React (scope) pkg: vue Related to Vue (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vue render-function components fail to build when @astrojs/react is enabled

1 participant