ds300 / patch-package

Fix broken node modules instantly šŸƒšŸ½ā€ā™€ļøšŸ’Ø
MIT License
10.47k stars 295 forks source link

@ngrx/component-store patch does not apply #470

Open VictorYar opened 1 year ago

VictorYar commented 1 year ago

patch-package 6.4.7 (the same error in last version too) I tried create patch for "@ngrx/component-store": "12.5.1", i just changed 3 files: 1) node_modules\@ngrx\component-store\fesm2015\ngrx-component-store.js this.isInitialized = true; initState(state) { scheduled([state], queueScheduler).subscribe((s) => { this.stateSubject$.next(s); }); }

2) node_modules\@ngrx\component-store\esm2015\src\component-store.js initState(state) { this.isInitialized = true; scheduled([state], queueScheduler).subscribe((s) => { this.stateSubject$.next(s); }); }

3) node_modules\@ngrx\component-store\bundles\ngrx-component-store.umd.js ComponentStore.prototype.initState = function (state) { var _this = this; _this.isInitialized = true; rxjs.scheduled([state], rxjs.queueScheduler).subscribe(function (s) { _this.stateSubject$.next(s); }); };

    run npx patch-package @ngrx/component-store

=> i got patch like ...\patches\@ngrx+component-store+12.5.1.patch with code:

diff --git a/node_modules/@ngrx/component-store/bundles/ngrx-component-store.umd.js b/node_modules/@ngrx/component-store/bundles/ngrx-component-store.umd.js index 9ba56cc..79b4d12 100644 --- a/node_modules/@ngrx/component-store/bundles/ngrx-component-store.umd.js +++ b/node_modules/@ngrx/component-store/bundles/ngrx-component-store.umd.js @@ -1,8 +1,8 @@ (function (global, factory) { .....

next i tried remove folder node_modules\@ngrx\ and runned npm got output:

Compiling @ngrx/component-store : main as umd patch-package 6.4.7 Applying patches... @ngrx/router-store@11.1.1 āœ” d3-drag@3.0.0 āœ” d3-zoom@3.0.0 āœ” devextreme@19.2.12 āœ”

ERROR Failed to apply patch for package @ngrx/component-store at path

node_modules/@ngrx/component-store

This error was caused because patch-package cannot apply the following patch file:

patches/@ngrx+component-store+12.5.1.patch

Try removing node_modules and trying again. If that doesn't work, maybe there was an accidental change made to the patch file? Try recreating it by manually editing the appropriate files and running:

patch-package @ngrx/component-store

If that doesn't work, then it's a bug in patch-package, so please submit a bug report. Thanks!

https://github.com/ds300/patch-package/issues

patch-package finished with 1 error(s).