Module not found: Can't resolve './App' in '/src'
Most likely cause: The App.js (or App.tsx) file is missing, deleted, or named differently (for example App.jsx or app.js with wrong case).
Try first: Check whether the App file exists
Likely causes
- The App.js (or App.tsx) file is missing, deleted, or named differently (for example App.jsx or app.js with wrong case).most likely
- The import path in index.js or main.js is incorrect or uses the wrong relative path or file extension.possible
- The file exists but is in a different folder or the project was not restarted after the file was added.less likely
How to fix it
Check whether the App file existsSafe
Open the /src folder in your file explorer or editor and look for a file named App.js, App.jsx, App.ts or App.tsx. Note the exact spelling and capitalization.
Verify the import statementSafe
Open the file that contains the import (usually src/index.js) and confirm it says exactly import App from './App' (or './App.jsx' etc.) with matching case and no extra folders in the path.
Create or rename the missing fileChanges settings
If the file is absent, create a new file named App.js (or matching your project's extension) inside the /src folder, or rename the existing file to the exact name the import expects.
If that didn't fix it
Run the build command again after confirming the file name and path match exactly, then check the full error output for the precise import line that failed.
When to see a technician
Consult a developer if you are not comfortable editing source files or if the project structure was generated by a framework you did not set up.
Quick answers
- What does Module not found: Can't resolve './App' in '/src' mean?
- This is a build error from a JavaScript bundler like webpack. It means your code tries to load a file called App (usually App.js or App.tsx) from the src folder, but that file cannot be found at the exact path and name used in the import statement.
- What causes Module not found: Can't resolve './App' in '/src'?
- The App.js (or App.tsx) file is missing, deleted, or named differently (for example App.jsx or app.js with wrong case). (most likely) The import path in index.js or main.js is incorrect or uses the wrong relative path or file extension. (possible) The file exists but is in a different folder or the project was not restarted after the file was added. (less likely)
- How do I fix Module not found: Can't resolve './App' in '/src'?
- Try these in order, safest first: 1. Check whether the App file exists. 2. Verify the import statement. 3. Create or rename the missing file.
- What if that didn't fix it?
- Run the build command again after confirming the file name and path match exactly, then check the full error output for the precise import line that failed.
- When should I see a technician?
- Consult a developer if you are not comfortable editing source files or if the project structure was generated by a framework you did not set up.