Patch may be applied multiple times
See original GitHub issueReduced test case: https://github.com/OliverJAsh/patch-package-multple-patches-bug
If you clone this test case and run yarn
multiple times, you’ll find that the patch which adds StreamApiError
applies each time yarn
is ran, resulting in corrupt code.
patch-package 6.2.2 (latest at time of writing)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:5
Top Results From Across the Web
Scopolamine (Transdermal Route) Proper Use - Mayo Clinic
Only one patch should be used at any time. Remove the patch after 3 days. If treatment is to be continued for more...
Read more >Fentanyl Transdermal Patch: MedlinePlus Drug Information
The patch is usually applied to the skin once every 72 hours. Change your patch at about the same time of day every...
Read more >Transdermal Patches: How to Apply Them - Healthline
If you're using more than one patch at a time, don't overlap them. And don't place one patch on top of another. The...
Read more >Buprenorphine for pain: medicine to treat severe pain - NHS
Do not apply more than 1 patch at a time, unless your doctor tells you to. Using more patches than recommended could lead...
Read more >Prescription Pain Patch: What Is It, Uses, Side Effects
Also known by the brand name Flector, it can be applied near the area of ... and never use more than one patch...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Btw a quick trick to prevent duplication is to make the patch idempotent, i.e. the original code no longer matches the patch after applying the change.
For example, in my case, I changed from:
to
Since it’s now an insertion instead of an addition, the patch sees the insertion points have changed and doesn’t get applied again.
Yeah, a comment in the middle did the trick, thanks!