How To Fix “SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled”?
Are you having problems with the issue “SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled“? How to fix it? In today’s article, I will provide solutions for you to solve the issues. Please follow the below steps to get the problem resolved now
How did “SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled” occur?
SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled
When you work with ReactJS, you may get the issue SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled. Don’t worry, we are here to provide you solutions in order to resolve your problem.
How to fix “SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled”?
To Solve SyntaxError – Support for experimental syntax jsx is not currently available Error Simply go to create a .babelrc
file, and then add this pne to the .babelrc
folder.
Solution 1: Create a .babelrc
File
Simple and easy solution: Simply copy create a .babelrc
file to the .babelrc
folder and include this line.
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
Solution 2: Create the babel.config.js
Simply create babel.config.js, and add the following content.
module.exports = {
presets:[
"@babel/preset-env",
"@babel/preset-react"
]
}
Solution 3: Set babelrc: true
- Simply open node_modules/react-scripts/config/webpack.config.js
-
Set
babelrc: true
- Your error should now be fixed
Final words
The above are useful solutions that can help you fix “SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled” problem, if you can’t solve it well. Please leave a message.