I'm working on a exercise react project and i got an error i couldn't fix still. I tried so many ways and didn't work.
This is app.js:
import {AddJob} from './Comps/AddJob.js'
import {JobList} from "./Comps/JobList.js"
import {DoneJobs} from "./Comps/DoneJobs.js"
function App() {
return (
<div className="container">
<div className="row justify-content-center">
<div className="col">
<AddJob />
</div>
<div className="col">
<JobList />
</div>
<div className="col">
<DoneJobs />
</div>
</div>
</div>
)
}
ReactDOM.render(<App />, document.getElementById('root'))
package.json:
{
"name": "react-starter-kit",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npx babel src/app.js --out-file=public/scripts/app.js --watch"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.22.10",
"@babel/core": "^7.22.10",
"@babel/plugin-transform-modules-commonjs": "^7.22.5",
"@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.22.5",
"@babel/register": "^7.22.5"
},
"dependencies": {
"@babel/standalone": "^7.22.10",
"babel-preset-env": "^1.7.0"
}
}
.babelrc:
{ "presets": [["@babel/preset-env",{ "modules": false }],"@babel/preset-react"] }
I tried to write "type":"module"
in package.json, i expected to work it but it didn't.