Can a Vue 3 + Typescript project use RxJS v7?

Viewed 696

Created a Vue3 + typescript project and added the rxjs 7 dependency using vue cli.

When I try import { Observable } from 'rxjs', I get Could not find a declaration file for module 'rxjs'

Trying to add @types/rxjs or adding a declare module 'rxjs' doesn't work. Adding rxjs to the tsconfig types doesn't either.

1 Answers

RXJS 7 requires TS 4.2+ See the breaking changes section.

The version used by Vue 3 generator (at the moment of writing this), is ~4.1.5. It is using ~ symbol, which won't use a 4.2.X version of TS.

Related