My Create React App is compiling over and over. Aside the fact is shouldn’t do that its also very distracting.
this is the output from the default npm run start
I’m guessing it’s something to do with linting, ideas?
EDIT:
scripts requested:
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint:check": "eslint . --max-warnings=0",
"lint:fix": "eslint . --fix --max-warnings=0",
"prettier:check": "prettier . --check",
"prettier:fix": "prettier . --write"
}
EDIT 2:
I have now removed all eslint packages from the project and deleted the prettier and eslint files and the app still behaves as shown in the GIF attached to this
EDIT 3:
For anyone who sees this, it still isn’t solved.
- removed linting completely
- redone all my typescript types and interfaces making sure they’re correctly referenced etc…
- tried it on Mac, Windows, Linux all of them do the same thing.
- Launched the app outside of an IDE using Powershell and zsh they do the same thing
- updated all my packages
- got a fresh tsconfig file
- removed node_modules
- tried yarn an npm both of them do the same
I’m at a loss here, the comments and answers are all helpful but non of them solve the issue.
2
Answers
there are seveal things that could be happening.
here are some from what I’ve encountered in the past:
npm start -- --reset-cache
. Clearing the cache might be helpful.eslint
andprettier
commands from package.json and rerun the project.My guess is that there’s a file somewhere in your project directory that gets updated continually. webpack detects the updates and rebuilds your project each time.
Here are some ways to test this theory:
react-scripts start
, create a minimalwebpack.config.js
(or copy the default one fromreact-scripts
) and run your project withwebpack serve
as your start script. Use a plug-in to determine which files are being updated.