Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix astro-entry error on build with multiple JSX frameworks #6967

Merged
merged 1 commit into from
May 2, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented May 2, 2023

Changes

Update the internal vite-plugin-jsx to ignore transforming for astro-entry: virtual files. These virtual files only contain re-exports to enable treeshaking used exports only (added in #6527), so they can be skipped as they don't contain JSX.

But also it's skipped to avoid this confusing (and harmless) error:

 building client 
10:19:41 PM [renderer] astro-entry:/Users/bjorn/Work/oss/astro/packages/astro/test/fixtures/static-build-frameworks/src/components/PCounter.jsx
Unable to resolve a renderer that handles this file! With more than one renderer enabled, you should include an import or use a pragma comment.
Add import React from 'react' or /* jsxImportSource: react */ to this file.

It happens in the static-build-frameworks fixture currently.

Testing

Existing tests should pass, but I also manually tested static-build-frameworks so there's no false errors on build.

Docs

n/a. bug fix.

@changeset-bot
Copy link

changeset-bot bot commented May 2, 2023

🦋 Changeset detected

Latest commit: f9c5cd0

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 the pkg: astro Related to the core `astro` package (scope) label May 2, 2023
@bluwy bluwy merged commit a8a319a into main May 2, 2023
@bluwy bluwy deleted the fix-astro-entry-error branch May 2, 2023 15:18
@astrobot-houston astrobot-houston mentioned this pull request May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants