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

not support preserveJsx when use builtin:swc-loader #4180

Closed
9aoy opened this issue Sep 12, 2023 · 4 comments
Closed

not support preserveJsx when use builtin:swc-loader #4180

9aoy opened this issue Sep 12, 2023 · 4 comments
Labels
feat New feature or request team The issue/pr is created by the member of Rspack.

Comments

@9aoy
Copy link
Contributor

9aoy commented Sep 12, 2023

System Info

none

Details

I want use vue jsx in rspack, but get an ReferenceError: React is not defined error

a6dd4828-0bcf-464a-83a6-30adcc1eb8be

1e027edb-84a7-4924-8640-d1eeea78aedf

Reproduce link

No response

Reproduce Steps

none

@9aoy 9aoy added bug Something isn't working pending triage The issue/PR is currently untouched. labels Sep 12, 2023
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Sep 12, 2023
@h-a-n-a h-a-n-a added feat New feature or request and removed bug Something isn't working pending triage The issue/PR is currently untouched. labels Sep 13, 2023
@h-a-n-a
Copy link
Contributor

h-a-n-a commented Sep 13, 2023

See thread here: swc-project/swc#5661

@9aoy
Copy link
Contributor Author

9aoy commented Sep 19, 2023

After adjusting the order of swc-loader and babel jsx plugin, the problem was solved...

image

@9aoy 9aoy closed this as completed Sep 19, 2023
@dejour
Copy link

dejour commented May 6, 2024

@9aoy could you share how to achieve this in rsbuild config.

@9aoy
Copy link
Contributor Author

9aoy commented May 7, 2024

@dejour In rsbuild, we let jsx syntax be processed by babel-loader first, so that when passing through swc-loader, there will be no jsx syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

No branches or pull requests

3 participants