Error after upgrade prevents `package.json` and `yarn.lock` from being updated
See original GitHub issueWhen I try to upgrade a dependency (using yarn upgrade
) and I get a new patch failure error from patch-package
, I’m left in a weird state where my node_modules
do reflect the changes, but my package.json
and yarn.lock
do not.
My presumption is that the patch-package error stops Yarn from commiting the update to the manifest and lockfile. I’m not sure this is desired behaviour, or whether this is a patch-package
problem or a Yarn problem.
Because of the error message, I thought it was safe to go in and re-apply my patch. So I edited node_modules
and ran patch-package
to generate the new patch, but because the upgrade was not committed, patch-package
created a patch of a diff between the version before the upgrade and the version after the upgrade with my changes, which took me awhile to realise.
If we can’t fix the bug whereby upgrades are not committed due to the error, we should provide clearer steps in the error message to avoid this.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
Hi @OliverJAsh I figured out a pragmatic solution: calling
exit(1)
on CI andexit(0)
locally. That prevents the confusing upgrade issues while also preventing bad patch files from sneaking past CI, without adding any extra commands. I’ll publish a fix for this shortly.Thanks!