close

[Fixed] SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled

Today We are Going To Solve SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled in Reactjs. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled Error?

  1. How to Fix SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled Error?

    To Fix SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled Error just Create a .babelrc file. To solve your error just create a .babelrc file in the root of your project and add this: { "presets": ["@babel/preset-env", "@babel/preset-react"] }

  2. SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled

    To Fix SyntaxError: Support for the experimental syntax ‘jsx’ isn’t currently enabled Error just Add “react-jsx”. Just add "jsx": "react-jsx" to your “compilerOptions” on your tsconfig.json file.

Solution 1 : Create a .babelrc file

To solve your error just create a .babelrc file in the root of your project and add this:

{
  "presets": ["@babel/preset-env", "@babel/preset-react"]
}

Solution 2 : Add “react-jsx”

Just add

"jsx": "react-jsx"

to your “compilerOptions” on your tsconfig.json file.

Solution 3 : Add the command

Just use the below command to solve your error.

yarn add webpack-dev-server -D

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read These Solutions

Leave a Comment