react-scripts start is serving old data
See original GitHub issueDescribe the bug
When using react scripts start
to serve Dev data, the served JSX is old/cached when it breaks.
For example, when I accidentally added ;
by accident to the end of some code, it broke, and it gave me the popup to say so. But when I then fixed it, that broken code is still being shown to me in the error, even after I both reload the page and even do a forced reload. I have saved the file multiple times and even opened the file itself in a separate program to make sure that it is indeed “fixed”, and it is. But webpack seems to think that nope, it is broken still.
Did you try recovering your dependencies?
Yes
Which terms did you search for in User Guide?
Old code, serving old code, build not updating
Environment
System: OS: Windows 10 10.0.20279 CPU: (12) x64 AMD Ryzen 5 1600 Six-Core Processor Binaries: Node: 12.14.1 - E:\Program Files\nodejs\node.EXE Yarn: Not Found npm: 6.14.10 - E:\OneDrive\GitHub\talespire\site\node_modules.bin\npm.CMD Browsers: Chrome: 87.0.4280.88 Edge: Spartan (44.20279.1.0) Internet Explorer: 11.0.20279.1 npmPackages: react: ^16.14.0 => 16.14.0 react-dom: ^16.14.0 => 16.14.0 react-scripts: ^4.0.1 => 4.0.1 npmGlobalPackages: create-react-app: Not Found
Steps to reproduce
- Create a CRA App
- start the server to serve it to the client to work on
- add a error
- fix the error
- see no change
Expected behavior
The code to change in the browser & console when I changed the file itself
Actual behavior
It didn’t change. Both console and the website give me this error , but the code it references is this https://starb.in/BjDNGR.js This is even the case after, reloading the page, clearing cache, restarting the server, uninstalling it (4.0.1) and reinstalling ^3.4 and back again. Even removing that whole function, saving, and adding it back in doesn’t fix. Breaking it will show the new error, but when that is fixed, it will show the old one and old code again. I got it to work once an hour ago and no idea how I did that.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:39
- Comments:18
Top GitHub Comments
Same pb here with “react-scripts”: “4.0.3” I confirm it looks like a problem with eslintcache
Note that since this version you will need to remove it this way
rm node_modules/.cache/.eslintcache
I’m on react-scripts 5.0.0 and running
rm -rf node_modules/.cache/
and thenyarn start
helped