-
-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React App Compilation failing due to missing eslint cache file #1656
Comments
One other thing I forgot to mention is - I'm using YARN rather than NPM directly. Could this also have an effect? My version of YARN is: 0.20.3 |
hmm, is the process running in a container that reads host filesystem? |
@viankakrisna It's using a shared volume which mounts my source code yeah. I've been using this custom image for a while with a few other projects and not had issues. It downloads the latest version of the |
Yup, can you try that? also, does setting the env CHOKIDAR_USEPOLLING=true helps? I think there are some delay between the filesystem and the watcher process. It helps in the vm, i don't know if it's also true in the docker |
@viankakrisna Hmmm just inspected my node_modules directory and the required json file is there. I did run an automated build which grabbed a fresh copy of the node base image just to rule that out. Looking at the last update to the node base image I was up to date anyway. The |
I appreciate the docker usage is probably outside your remit :) |
yup, can you also try the CHOKIDAR_USEPOLLING? need to rule out all option before fire up a docker image to dig on that. Here's the link to do that /~https://github.com/facebookincubator/create-react-app/blob/5155797983476260a6e6e8d93ca38b43233d82de/packages/react-scripts/template/README.md#npm-start-doesnt-detect-changes |
Looking at the If If It seems like |
@gaearon Hi Dan, Thanks for the breakdown. I currently can't replicate this issue as the |
Bumped into this issue. Super frustrating 😞 |
From what I noticed: this issues consistently appears after yarn-installing new module. |
confirmed that this is consistently happening after yarn installing new module. I'm digging on it right now |
Going to revert this in the next version: #1665. |
^^OUTDATED Please use /~https://github.com/viankakrisna/eslint-loader/tree/port_babel_loader_fs_cache instead. You need to replace eslint-loader folder in Note: you need to restart the dev server so webpack can read the patch |
@viankakrisna Hey I've tested this and it appears to work. I tested by running |
@dylanrhysscott Great! Glad that it helps. Not sure what causes the bomb though 😭 If anybody wants to try a reimplementation of eslint-loader cache with babel-loader's fs-cache, you can try it here webpack-contrib/eslint-loader#159 Feedbacks are gladly appreciated |
@viankakrisna Not sure if helpful, but I had the same issue after using yarn to add purecss. I tried your patch, and in my case it did not fix the issue. I don't have a great deal of dev experience, so please take that into consideration. I'm on Windows. I had to resort to deleting node_modules and reinstalling. Thanks to everyone for their contributions here. |
Which of two patches in this thread did you try? Have you restated the server after applying it? |
@gaearon I used the patch located at: https://gist.github.com/viankakrisna/76ee7702e3592ab743cea63787e47295 I'm trying to remember, but I think it's possible that I overlooked restarting the server, as I recall spending some of my time trying to decipher the error message provided by create-react-app in the original browser window. In retrospect that should have been obvious. My apologies, you can most likely disregard my input. |
@viankakrisna Hi just ran into this error again after YARN adding a package. Still had the fix applied and it threw the same error. Looks like an issue with larger more complete YARN packages being added than the one I initially tested. After adding a package my .cache directory appears to be missing again :(. Any ideas? |
@dylanrhysscott I've updated the gist after the last time i publish it, can you try it? Also, do you check that the patched file is intact inside the node_modules? I'm beginning to think that every time you run yarn it will overwrite the folders inside node_modules with its own cached version. I've published another fix in here /~https://github.com/viankakrisna/eslint-loader/tree/port_babel_loader_fs_cache which uses The pr is here webpack-contrib/eslint-loader#159. Need to port the test from babel-loader to let the CI passes @gaearon I'm beginning to think that it's wiser to do revert and wait until eslint-loader cache implementation tested and tried for a while before enabling it. It's too frustrating for the user to experience this... And i'm sorry for the silly pull request that started it all... |
@viankakrisna Confirmed looks like YARN is overwriting the patch file....I've cloned your fixes into my |
Hang on! Looks like my project is using a different directory from where I applied the fix... let me test :) |
@viankakrisna OK so I've successfully applied the fix now in the |
The only fix I want somebody to try is /~https://github.com/viankakrisna/eslint-loader/tree/port_babel_loader_fs_cache. Did anyone try it yet? |
@dylanrhysscott you need to clone it in your so the path is like this I don't think it will persist while yarn is always overwriting the folders though. And yes, revert should be in order, currently i'm stuck with tests to get the pr of porting |
@viankakrisna Cheers I figured that after I did it :) Yeah YARN is overwriting it still @gaearon I think that was the one I tried once I got it in the correct directory. Let me know if there is any more tests you'd like me to run! |
I've setup a repo of react-scripts with
To
and do |
I’m going to move ahead with the revert for now, but happy to take another PR for 0.9.4 when this is sorted out. |
@viankakrisna Sweet! Swapping out those devDeps to your repo seems to have fixed it! I have added a few packages and can still compile. Same in reverse 👍 |
@dylanrhysscott I will keep the repo until 0.9.3 released. I naively based this repo on the master branch. which uses webpack2... |
Yea, need to be careful with that 😛 Master branch is very unstable. |
@gaearon @viankakrisna Thanks for your help guys. Much appreciated! |
I landed a revert of this in 0.9.3. |
deleted react-scripts patch repo and gists so we can focus on /~https://github.com/viankakrisna/eslint-loader/tree/port_babel_loader_fs_cache |
@viankakrisna Cheers will update as soon as I can. Looks like I'm having issues with a bug in YARN upgrades atm. It really hasn't been my week for bugs :P Thanks! |
@viankakrisna Just bumped the version on my project - all resolved! |
Can you reproduce the problem with latest npm?
Yes
Description
React app compilation is periodically / intermittently failing with the error due to a change in eslint-caching as per #1578. A cache file is missing in the
node_modules
directoryExpected behavior
App should compile with no errors
Actual behavior
The
create-react-scripts
throw the following error when compiling on file change:On closer inspection this seems to happen when I rename / add a new file. However it happens so randomly it has been difficult to pin down.
Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected):node -v
:npm -v
:Operating system: OSX running Docker Image: https://hub.docker.com/r/dylanrhysscott/docker-react-dev/ which is based off of official node images
Browser and version: Chrome 56.0.2924.87 (64-bit)
Ping @Timer - Here's the issue. I can't provide my project as its on a private Git server internally but will do all I can to help troubleshoot. Hope this helps!
The text was updated successfully, but these errors were encountered: