patch-package icon indicating copy to clipboard operation
patch-package copied to clipboard

@ngrx/component-store patch does not apply

Open VictorYar opened this issue 2 years ago • 0 comments

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/[email protected][email protected][email protected][email protected]

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).

VictorYar avatar Jun 02 '23 13:06 VictorYar