Search code examples
reactjscreate-react-app

Module not found : Can't resolve './App' in 'C:\Users\user\Desktop\react-challenge\sample\src'


I am learning react from a playlist and had created a basic app with create-react-app it was up and running without any issues initially. After I deleted some files in 'src' and 'public' ,the terminal is showing this error:

./src/index.js
Module not found: Can't resolve './App' in 'C:\Users\user\Desktop\react-challenge\sample\src'

I deleted everything except for 'index.html' in public and 'index.js' in src file. I have attached the folder structure and index.js below.

This is my current folder structure

This is my index.js code

EDIT: it was an issue regarding the files getting saved and reloading it is solved now.


Solution

  • It's fine to delete App.js if you're not using it, and it looks like you're not. You probably just need to restart your development server.

    Stop it with Ctrl + C
    Start it again with npm start or yarn start