Support for the experimental syntax 'jsx' isn't currently enabled
See original GitHub issueBug Report
- I would like to work on a fix!
Current behavior
Add @babel/plugin-transform-react-jsx (https://git.io/vb4yd) to the ‘plugins’ section of your Babel config to enable transformation.
Input Code import my own local npm package into a create-react-app project
const MyComponent = () => {
return (
<div>
<button type="button">Click me</button>
<p>Hello</p>
</div>
)
}
Expected behavior expect to work successfully!!
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
- Filename:
package.json
{
...,
"devDependencies": {
"@babel/core": "^7.11.4",
"@babel/plugin-transform-react-jsx": "^7.10.4",
"@babel/plugin-transform-react-jsx-self": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-react": "^7.10.4",
"babel-loader": "^8.1.0",
"css-loader": "^4.2.2",
"reactstrap": "^8.5.1",
"style-loader": "^1.2.1",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12"
},
"babel": {
"presets": [
"@babel/preset-react",
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-transform-react-jsx"
]
}
}
Environment
System:
OS: macOS 10.15.6
Binaries:
Node: 14.5.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.7 - /usr/local/bin/npm
npmPackages:
@babel/core: ^7.11.4 => 7.11.4
@babel/plugin-transform-react-jsx: ^7.10.4 => 7.10.4
@babel/plugin-transform-react-jsx-self: ^7.10.4 => 7.10.4
@babel/preset-env: ^7.11.0 => 7.11.0
@babel/preset-react: ^7.10.4 => 7.10.4
babel-loader: ^8.1.0 => 8.1.0
webpack: ^4.44.1 => 4.44.1
- Babel version(s): [6.18.0 (babel-core 6.18.2)]
- Node/npm version: [Node 14.5.0/npm 6.14.7]
- OS: [macOS Catalina 10.15.6]
- Monorepo: [no]
- How you are using Babel: [
package.json
, using.babelrc
still not working]
Possible Solution
Additional context
Add any other context about the problem here. Or a screenshot if applicable
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Support for the experimental syntax 'jsx' isn't currently enabled
Just create a .babelrc file in the root of your project and add: { "presets": ["@babel/preset-env", "@babel/preset-react"] }.
Read more >Support for the experimental syntax 'jsx' isn't currently enabled ...
Support for the experimental syntax 'jsx' isn't currently enabled after creating a TypeScript react project and installing an NPM package with ...
Read more >Jest error parsing React jsx files “Support for the experimental ...
Jest error parsing React jsx files “Support for the experimental syntax 'jsx' isn't currently enabled”. I ran into this error adding new Jest ......
Read more >Support for the experimental syntax 'jsx' isn't currently enabled
JavaScript : Support for the experimental syntax ' jsx ' isn't currently enabled [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] ...
Read more >Babel Config Error: Support for the experimental syntax 'jsx ...
Coding example for the question Babel Config Error: Support for the experimental syntax 'jsx' isn't currently enabled-Reactjs.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
fixed, thank you @JLHwung
@007tom I don’t see new replies here. I can lock this thread if you see spam comments.