-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Appending CRA gitignore to existing .gitignore fails due to fs-extra v8 #7892
Comments
Ps: I can submit a PR, but it might be a lot faster for a core team member to fix that line in init.js... But please do let me know! |
It looks like you're installing from a fork of CRA ( |
Disclaimer: this issue is on the It's weird though, I can't reproduce using your package, even though the only substantial thing I modified in mine are a few paths in It shouldn't work though, because: But maybe there are some internals I'm not fully grasping? |
It is very strange to have the I can't find any notes about these renamings in the fs-extra changelog. |
I know, it's weird... Here is the culprit line: https://github.com/jprichardson/node-fs-extra/blob/8.1.0/lib/move-sync/move-sync.js#L25 (as you can see an error is thrown with no code attached) And here is the diff v7/v8: jprichardson/node-fs-extra@0bc36ff#diff-ed59bd97e02b23238a4db2f82738f5f3 |
also seeing this in a fork which is using I've isolated this snippet of code into two REPLs ✔️ fs-extra@7.0.1 Not sure how to proceed. I I think the appropriate next step would be to ask fs-extra to throw a specific code? as @mjsarfatti mentions, this will be a 3.3.0 bug if released. We opened it as a story because a common generation flow is to init a repo in GitHub first, with README and .gitignore files, and then CRA into that repo EDIT: opened an issue on the fs-extra repo EDIT 2: received word from the fs-extra team that this is now by design. If so, then, should this code change to look directly for the message |
I've confirmed in the PR that fixes this issue that this is now an active bug in |
Describe the bug
Creating a new app in a folder with an existing .gitignore fails with error
Error: dest already exists.
. This is using the master branch (I discovered it while forking it to customize CRA), but it will happen on tagged releases as well.The reason is
react-scripts/scripts/init.js:175
checks for:in order to decide whether to append CRA's gitignore to the existing file. But
fs-extra/moveSync v8
instead of throwing an error with codeEEXIST
seems to be throwing an error with messagedest already exists.
and undefined code.Before v8: jprichardson/node-fs-extra@0bc36ff#diff-ed59bd97e02b23238a4db2f82738f5f3L29
After v8: jprichardson/node-fs-extra@0bc36ff#diff-04b1b5a0bc03a081b62ca97774ac1443R27
Did you try recovering your dependencies?
Not applicable.
Which terms did you search for in User Guide?
"EEXIST", "dest already exists", "gitignore".
Environment
Steps to reproduce
cd
into the folder and runnpx create-react-app .
Expected behavior
App is initialized and CRA gitignore is appended to existing .gitignore
Actual behavior
Installation fails. Here is the last lines of the console log:
Reproducible demo
Not applicable.
The text was updated successfully, but these errors were encountered: