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

Support for the experimental syntax 'jsx' isn't currently enabled #71

Open
hyperknot opened this issue Nov 25, 2024 · 2 comments
Open

Comments

@hyperknot
Copy link

I get this when trying to use it with Vite + Solid starter.

Support for the experimental syntax 'jsx' isn't currently enabled (8:14):

Add @babel/preset-react (https://github.com/babel/babel/tree/main/packages/babel-preset-react) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx) to the 'plugins' section to enable parsing.

If you already added the plugin for this syntax to your config, it's possible that your config isn't being loaded.
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded configuration:
	npx cross-env BABEL_SHOW_CONFIG_FOR=index.jsx <your build command>
See https://babeljs.io/docs/configuration#print-effective-configs for more info.I 
@RainArroDev
Copy link

How to fix:

add @babel/plugin-syntax-jsx -D

import { macaronVitePlugin } from '@macaron-css/vite';
import { defineConfig } from '@solidjs/start/config';

export default defineConfig({
  vite: {
    plugins: [
      macaronVitePlugin({
        babel: {
          plugins: ['@babel/plugin-syntax-jsx']
        },
      }),
    ],
  },
});

@hyperknot
Copy link
Author

I see, thanks. I've settled on stylex in the meanwhile, but good to know if there is a fix.

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

No branches or pull requests

2 participants