Open rolivegab opened 4 years ago
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
Issue still persists.
IMHO, these scripts shouldn't be doing anything in my home directory period unless its in a specific, well-named directory specific to react scripts. What is the justification for this anyway?
I did a bit of digging.
The bug is caused by chokidar library not policing its errors when trying to resolve symlinks. https://github.com/paulmillr/chokidar/blob/3.4.2/lib/nodefs-handler.js#L424
I'll create a bug report there.
I don't know why the script is trying to read outside of its project directory, I haven't dug that far.
EDIT: Seems they refactored all this in newer versions. watchpack
should update its dependencies.
CORRECTION EDIT: Fix still not merged: https://github.com/paulmillr/chokidar/pull/1010
Today i looked closer at why my react-scripts server is randomly crashing during development (only happens after multiple hours or days) and came across the same issue as op:
Compiling...
/home/alex/work/bla/blabla/myproject/node_modules/react-scripts/scripts/start.js:19
throw err;
^
[Error: ENOENT: no such file or directory, stat '/home/alex/.steampath'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/alex/.steampath'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myproject@0.1.0 dev: `npx rimraf node_modules && npm i && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myproject@0.1.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/alex/.npm/_logs/2021-01-23T08_43_37_732Z-debug.log
It's easy to fix with a simple restart, but what i don't understand is: WHY THE HECK IS IT TRYING TO ACCESS MY STEAM STUFF OR STAT-ING MY PRIVATE HOME DIR AT ALL? Does Facebook really need to know what's in my steam lib or how many hours i've killed in Hatoful Boyfriend?
Having same issue.
Compiling...
/home/erfan/Documents/GitLab/SurgAccord/surgaccord-landing/node_modules/react-scripts/scripts/start.js:19
throw err;
^
[Error: ENOENT: no such file or directory, stat '/home/erfan/.steampath'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/erfan/.steampath'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Only happens when a module is not found. The main problem is that the developement crashes and I should npm start
again. Which is quite annoying.
Really don't know why it is behaving like that...
The bug has almost an year now(this isnt the first time it has been reported #9156 ).... Maybe some additional info might help... In my case the dev server crashes completely if I use relative paths (have .env file with NODE_PATH=src
) for imports like this:
import ComponentA from "myComponentsFolder/ComponentA"
import { ComponentB } from "myComponentsFolder/ComponentB"
But ComponentA.js
doesn't exist inside myComponentsFolder
, same thing happens if the folder doesn't exist and same thing happens if A exists and B doesn't, the dev server should throw a "ComponentA is missing", not completely crash...
As a workaround to actually find what I'm missing I'm running npm run-script build
, but that's at least a minute lost everytime I'm missing a component or haven't even defined it yet....
Edit: Oh yeah, in my case I don't even see the module missing, just the error like erfoon has... Edit2: It also crashes from some npm packages downloaded but not all, I don't know which crash and which don't...
@alisscco Maybe also add as a feature something like -v / --verbose
to react-scripts
so it doesn't clear the console?
I'm getting this while calling npm start
, is there any workaround? I keep getting the error, it never really compiles.
edit: I deleted the .steampath
file and now it gives me an actual error that a package was missing. Installed the package and now it works. Simply restarting for me did not work, as others have stated.
I'm getting this same error (when running storybook), but I have no missing package. If I delete the broken symlinks the errors stops appearing but this is very awkward
The bug has almost an year now(this isnt the first time it has been reported #9156 ).... Maybe some additional info might help... In my case the dev server crashes completely if I use relative paths (have .env file with
NODE_PATH=src
) for imports like this:import ComponentA from "myComponentsFolder/ComponentA" import { ComponentB } from "myComponentsFolder/ComponentB"
But
ComponentA.js
doesn't exist insidemyComponentsFolder
, same thing happens if the folder doesn't exist and same thing happens if A exists and B doesn't, the dev server should throw a "ComponentA is missing", not completely crash...As a workaround to actually find what I'm missing I'm running
npm run-script build
, but that's at least a minute lost everytime I'm missing a component or haven't even defined it yet....Edit: Oh yeah, in my case I don't even see the module missing, just the error like erfoon has... Edit2: It also crashes from some npm packages downloaded but not all, I don't know which crash and which don't...
One can use the debugger to pause at the message point!
You can check that here: https://stackoverflow.com/a/68370804/7668448
Today i looked closer at why my react-scripts server is randomly crashing during development (only happens after multiple hours or days) and came across the same issue as op:
Compiling... /home/alex/work/bla/blabla/myproject/node_modules/react-scripts/scripts/start.js:19 throw err; ^ [Error: ENOENT: no such file or directory, stat '/home/alex/.steampath'] { errno: -2, code: 'ENOENT', syscall: 'stat', path: '/home/alex/.steampath' } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! myproject@0.1.0 dev: `npx rimraf node_modules && npm i && react-scripts start` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the myproject@0.1.0 dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/alex/.npm/_logs/2021-01-23T08_43_37_732Z-debug.log
It's easy to fix with a simple restart, but what i don't understand is: WHY THE HECK IS IT TRYING TO ACCESS MY STEAM STUFF OR STAT-ING MY PRIVATE HOME DIR AT ALL? Does Facebook really need to know what's in my steam lib or how many hours i've killed in Hatoful Boyfriend?
It's just checking the home directory! And iterating through all files! Why ?? I duno! Didn't Find why yet!
Otherwise here the same error but with a broken symlink on my name
Suggestion for others who land here, I ran
npm run start &> /tmp/output
so I could see which package was missing. &>
may be a bash-specific construct—it redirects both stdout and stderr.
Suggestion for others who land here, I ran
npm run start &> /tmp/output
so I could see which package was missing.
&>
may be a bash-specific construct—it redirects both stdout and stderr.
it worked. Thanks
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
This problem still existed.
+1
+1
Describe the bug
If some module resolution fails, react-scripts try to stat all files in user's home directory. if there are some broken link no home folder, development server crashes.
Did you try recovering your dependencies?
Yes.
Which terms did you search for in User Guide?
.steampath
Related, and explained comment: https://github.com/facebook/create-react-app/issues/9156#issuecomment-645512859
Environment
Steps to reproduce
Since it depends on machine's having a broken link on home directory, you need to create a broken file there. My .steampath file is just a broken link:
npm start
force a module resolution failed, or something output:
Expected behavior
react-scripts should not stop development server because a broken link in home directory.