Closed jessejohnsohn closed 4 years ago
Update: copying the data-persistence.ts file locally and referencing it fixes the problem. So I'm guessing it's some sort of dependency issue?
This won't be the case after #2264 lands.
The reason you are seeing this error message is because the typings are using two different versions of rxjs. If you can align them, it might work. However, I recommend waiting for the official release.
Hopefully this answers your question. I am going to close this issue. You can reopen it if something is unclear :)
@FrozenPandaz I still see this problem after upgrading to nx 9.0.2. Should this be already fixed?
Removing package-lock.json and regenerating it with npm install
seems to resolve the dependency problem.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Expected Behavior
This is a very basic implementation of an ngrx effect using the DataPersistence.navigation method.
I expected the project to build; although, this is using Angular v9, which isn't officially supported yet.
Current Behavior
The build fails with a lengthy error message (provided below).
Failure Information (for bugs)
`ERROR in src/app/+state/app.effects.ts:15:7 - error TS2322: Type '(_r: ActivatedRouteSnapshot, _state: AppState) => Observable<ActionCreator<"[App] App Launched", () => TypedAction<"[App] App Launched">>>' is not assignable to type '(a: ActivatedRouteSnapshot, state?: AppState) => void | Action | Observable'.
Type 'Observable<ActionCreator<"[App] App Launched", () => TypedAction<"[App] App Launched">>>' is not assignable to type 'void | Action | Observable'.
Type 'Observable<ActionCreator<"[App] App Launched", () => TypedAction<"[App] App Launched">>>' is not assignable to type 'Observable'.
The types of 'source.operator.call' are incompatible between these types.
Type '(subscriber: import("C:/dev/NxDataPersistenceBug/node_modules/rxjs/internal/Subscriber").Subscriber, source: any) => import("C:/dev/NxDataPersistenceBug/node_modules/rxjs/internal/types").TeardownLogic' is not assignable to type '(subscriber: import("C:/dev/NxDataPersistenceBug/node_modules/@nrwl/angular/node_modules/rxjs/internal/Subscriber").Subscriber, source: any) => import("C:/dev/NxDataPersistenceBug/node_modules/@nrwl/angular/node_modules/rxjs/internal/types").TeardownLogic'.
Types of parameters 'subscriber' and 'subscriber' are incompatible.
Property '_parentOrParents' is missing in type 'import("C:/dev/NxDataPersistenceBug/node_modules/@nrwl/angular/node_modules/rxjs/internal/Subscriber").Subscriber' but required in type 'import("C:/dev/NxDataPersistenceBug/node_modules/rxjs/internal/Subscriber").Subscriber'.
15 run: (_r: ActivatedRouteSnapshot, _state: AppState) => {
node_modules/@nrwl/angular/src/runtime/nx/data-persistence.d.ts:33:5 33 run(a: ActivatedRouteSnapshot, state?: T): Observable | Action | void;