0

I'm adding RxJS into Angular app. After installing RxJS, I got errors: error TS2305: Module '"rxjs"' has no exported member 'tap'.

for the line of code:

import { catchError, tap } from "rxjs"

After running >npm start I'm getting list of errors: enter image description here

I tried to install RxJS below, it didn't help.

npm install rxjs npm i rxjs-compat

Application located here: github.com/sam-klok/angular-kendo-grid-reactive

PS Some people suggesting similarity with Angular - "has no exported member 'Observable'" I believe that it's overall useful article, however in my case library Observable working fine, and fixing methods described in it, didn't help to solve the issue.

sam sergiy klok
  • 526
  • 7
  • 17

2 Answers2

0

I looked at the code of the application and see that it use Angular 12 and older version of RxJS (see screen of package.json below). And tap.ts file is "almost" empty, which tells me that something is with versions incompatibility. Currently I'm upgrading everything to Angular 13, and newer version of RxJS, will report later if it is a solution.

Basically solution was to upgrade version of Angular in this project. enter image description here

enter image description here

sam sergiy klok
  • 526
  • 7
  • 17
0

Try importing them from the operators. Those APIs were moved there a while ago even tho I do not know by heart now from what version on this applies:

import { catchError, tap } from "rxjs/operators";
Thomas
  • 2,375
  • 2
  • 17
  • 32