xxxxxxxxxx
I got stuck at the same problem today. I spent hours searching for a solution. Nothing worked. Finally, I did something like this:
Try running this command-
npm start -- --reset-cache
in your root project directory and this error will be resolved.
The purpose of this command is that it starts the npm after resetting the cache.