joshwcomeau / guppy

🐠A friendly application manager and task runner for React.js
ISC License
3.27k stars 154 forks source link

package.json gets wiped and committed sometimes (inconsistent) #332

Open melanieseltzer opened 5 years ago

melanieseltzer commented 5 years ago

Describe the bug

Haven't looked into this properly yet but I am encountering a weird bug that is happening on and off, but nothing consistent. If I have 0 projects in the app and then create one (been always CRA but might happen with other types), the package.json of that project will get wiped (empty file) and committed (when we add the 'Add Guppy data to package.json' commit).

So then when I try to eject, git state is unclean and when I go to diff it, it shows the package.json full contents trying to be added. So somehow it's getting wiped in the split second before the commit goes through, and added again right after, alerting that's there's an uncommitted change in git.

To Reproduce

Pretty inconsistent. I've come across it maybe 20 - 30% of the time of creating new projects to test the reinstall/eject features. The only thing I noticed was it seemed to happen if the project was the only project in the app. But not sure if this is a direct correlation.

Expected behavior

Screenshots

Environment (please complete the following information):

Additional context