Support for the experimental syntax 'jsx' isn't currently enabled
Solution 1:
Just create a .babelrc
file in the root of your project and add:
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
Solution 2:
In my case, Creating "babel.config.js" file with the following content worked.
module.exports = {
presets:[
"@babel/preset-env",
"@babel/preset-react"
]
}
Solution 3:
This https://stackoverflow.com/a/52693007/10952640 solved for me.
You need @babel/preset-react set also on webpack config:
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
options: { presets: ['@babel/env','@babel/preset-react'] },
},
Solution 4:
2021
I fixed it adding
"jsx": "react-jsx"
to my "compilerOptions" on my tsconfig.json file
Solution 5:
Yet another possible cause. I got this error when try to run a project in a command prompt at a path that included symlinks. Changing directory directly into the real path solved the issue.