Choose one: is this a π bug report or π feature request?
maybe bug or I missing something
{
"name": "learn",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"parcel-bundler": "^1.6.2"
},
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0"
}
}
run parcel and react with zero config
Automatic JSX support for React doesnt work without .babelrc ?
doesn't work
/Users/mmakmur/learn/src/app.jsx:5:9: Unexpected token (5:9)
3 |
4 | const App = () => {
> 5 | return <p>hallo</p>;
| ^
6 | };
7 | ReactDom.render(<App />, document.getElementById("app"));
8 |
when I add .babelrc jsx parcel run with no error.
{
"plugins": ["transform-react-jsx"]
}
sould I use "transform-react-jsx" in .babelrc ?
run parcel and react with zero config
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | v1.62
| Node | v9.5.0
| npm/Yarn | npm
| Operating System | mac
Works for me with:
<div id="app"></div>
<script src="./index.js"></script>
import React from 'react';
import ReactDom from 'react-dom';
const App = () => {
return <p>hallo</p>;
};
ReactDom.render(<App />, document.getElementById("app"));
@xabree Can you please fill out the βYour Environmentβ section of the issue template.
Also, it would be really useful if you can provide an example repo (or upload a zip) so we can try to reproduce the issue.
HI all thank for the response.
@mischnic the script is same with you , I think is not syntax error. but jsx is not automatically supported in my environtment maybe.
@davidnagli I Update environment
Without your code (maybe you can strip out as much code as you can), we can't help you.
This works: https://gist.github.com/mischnic/4a2c121c1074c7a9e5ec657db02637ac (no babelrc should be needed)
Also would be nice if you could run parcel -V to make sure you don't have a previous version installed globally
I'm sorry my mistake, I have already old parcel version installed globally.
@mischnic @DeMoorJasper Thank You. now parcel and react run with zero config :)
Most helpful comment
Works for me with: