question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DataPersistence is throwing a build error (using Ivy)

See original GitHub issue

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<Action>’. Type ‘Observable<ActionCreator<“[App] App Launched”, () => TypedAction<“[App] App Launched”>>>’ is not assignable to type ‘void | Action | Observable<Action>’. Type ‘Observable<ActionCreator<“[App] App Launched”, () => TypedAction<“[App] App Launched”>>>’ is not assignable to type ‘Observable<Action>’. The types of ‘source.operator.call’ are incompatible between these types. Type ‘(subscriber: import(“C:/dev/NxDataPersistenceBug/node_modules/rxjs/internal/Subscriber”).Subscriber<any>, 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<any>, 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<any>’ but required in type ‘import(“C:/dev/NxDataPersistenceBug/node_modules/rxjs/internal/Subscriber”).Subscriber<any>’.

15 run: (_r: ActivatedRouteSnapshot, _state: AppState) => { ~~~

node_modules/rxjs/internal/Subscription.d.ts:23:15 23 protected _parentOrParents: Subscription | Subscription[]; ~~~~~~~~~~~~~~~~ ‘_parentOrParents’ is declared here. node_modules/@nrwl/angular/src/runtime/nx/data-persistence.d.ts:33:5 33 run(a: ActivatedRouteSnapshot, state?: T): Observable<Action> | Action | void; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The expected type comes from property ‘run’ which is declared here on type ‘HandleNavigationOpts<AppState>’`

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Clone this repo
  2. Npm install
  3. Ng build
  4. Observe error

(

If you can provide steps to reproduce from scratch, that would be enormously appreciated (i.e. where the first step is npx create-nx-workspace@latest repro-workspace)

Context

Please provide any relevant information about your setup:

“dependencies”: { “@angular/animations”: “~9.0.0-rc.11”, “@angular/cdk”: “~9.0.0-rc.8”, “@angular/common”: “~9.0.0-rc.11”, “@angular/compiler”: “~9.0.0-rc.11”, “@angular/core”: “^9.0.0-rc.11”, “@angular/flex-layout”: “^9.0.0-beta.28”, “@angular/forms”: “~9.0.0-rc.11”, “@angular/material”: “^9.0.0-rc.8”, “@angular/platform-browser”: “~9.0.0-rc.11”, “@angular/platform-browser-dynamic”: “~9.0.0-rc.11”, “@angular/router”: “~9.0.0-rc.11”, “@ngrx/effects”: “^8.6.0”, “@ngrx/entity”: “^8.6.0”, “@ngrx/router-store”: “^8.6.0”, “@ngrx/store”: “^8.6.0”, “@ngrx/store-devtools”: “^8.6.0”, “@nrwl/angular”: “^8.12.0”, “@nrwl/workspace”: “^8.12.0”, “rxjs”: “^6.5.3”, “tslib”: “^1.10.0”, “zone.js”: “~0.10.2” }, “devDependencies”: { “@angular-devkit/build-angular”: “^0.900.0-rc.10”, “@angular-devkit/build-ng-packagr”: “~0.900.0-rc.10”, “@angular/cli”: “^9.0.0-rc.10”, “@angular/compiler-cli”: “~9.0.0-rc.11”, “@angular/language-service”: “~9.0.0-rc.11”, “@ngrx/schematics”: “^8.6.0”, “@types/node”: “^13.5.1”, “codelyzer”: “^5.0.0”, “ng-packagr”: “^9.0.0-rc.7”, “prettier”: “^1.19.1”, “ts-node”: “^8.6.2”, “tsickle”: “^0.38.0”, “tslint”: “~5.15.0”, “typescript”: “^3.7.5” }

A minimal reproduction scenario allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.

Failure Logs

Error message provided above.

Other

I know this is Ivy and Typescript 3.7.5, but I’m really curious about why this is breaking. Even if you don’t fix it right away, if you can give me some sort of advice as to where to look in the source code.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
FrozenPandazcommented, Jan 31, 2020

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.

0reactions
stijnvncommented, Feb 25, 2020

Removing package-lock.json and regenerating it with npm install seems to resolve the dependency problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

getting error in ivy.xml throwing exception - Stack Overflow
Ivy is designed to manage a software projects dependencies, using an ivy file that is normally committed locally into the source code.
Read more >
Using Data Persistence operators - Nx
Using Data Persistence operators. Managing state is a hard problem. We need to coordinate multiple backends, web workers, and UI components, ...
Read more >
BusinessDataRepository (Axon.ivy Public API (Version 7.1.0.58195))
Business data value or a new instance associated with the current business case. Throws: IllegalArgumentException - if type has no BusinessCaseData annotation.
Read more >
Hazelcast IMDG Reference Manual
You can build your own custom-distributed data structures using the Service ... Hazelcast throws a meaningful exception if there is an error in...
Read more >
All Blog Posts by Ben Nadel
Building -Up A Complex Objects Using A Multi-Step Form Workflow In ColdFusion ... Errors Thrown In Future Threads Don't Report Complete Details In...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found