I have a React project in which everything was running fine until I changed the extension of App.js from the components folder to App.jsx
Here is a screenshot of the folder:
When I run npm start
, got the following error:
Error: ENOENT: no such file or directory, open 'D:\phone\src\components\App.js'
index.js
import ReactDOM from "react-dom"
import App from "./components/App"
ReactDOM.render(<App />, document.getElementById("root"))
package.json
...
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
...
I read here https://stackoverflow.com/a/46169636/12611597 that these extensions are completely interchageable. How to configure the transpiler?
So Why is this error ocurring?