question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-scripts start is serving old data

See original GitHub issue

Describe 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

  1. Create a CRA App
  2. start the server to serve it to the client to work on
  3. add a error
  4. fix the error
  5. 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 image , 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:open
  • Created 3 years ago
  • Reactions:39
  • Comments:18

github_iconTop GitHub Comments

121reactions
Poyoman39commented, Mar 11, 2021

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

25reactions
tomsjansonscommented, Feb 25, 2022

I’m on react-scripts 5.0.0 and running rm -rf node_modules/.cache/ and then yarn start helped

Read more comments on GitHub >

github_iconTop Results From Across the Web

Everything you need to know about react-scripts
In this guide, we'll give an overview of react-scripts, compare a few different types of scripts, and describe how Create React App dramatically ......
Read more >
React app stuck on "Starting the development server"
I have a react project that I want to convert to Typescript and I started as you noted with the "create-react-app", added all...
Read more >
Migrating from Create React App - Next.js
Migrating from Create React App. This guide will help you understand how to transition from an existing non-ejected Create React App project to...
Read more >
"The NPM script 'start' exited without indicating that the create ...
From the error message, it seems that the react-scripts.js module was not found, try to check the package.json file whether it contains the ......
Read more >
The React Scripts Start Command – Create-React-App NPM ...
The script generates the required files and folders to start the React application and run it on the browser. This allows you to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found