Angular 5 -> Angular 6 Rxjs .map() to .pipe(map())

16,229

Maybe this can help?

I followed all steps in https://update.angular.io/, but somehow at the end of chain I had the same problem you have: all my rxjs imports were changed, but the operators hadn't been changed to pipeable operators.

Then I noticed that the rxjs-compat package hadn't been installed (due to https://github.com/angular/angular-cli/issues/10631?). After installing rxjs-compat manually (npm install rxjs-compat --save) and running rxjs-5-to-6-migrate -p src/tsconfig.app.json again, the pipes appeared!

Share:
16,229
lynxSven
Author by

lynxSven

Updated on June 11, 2022

Comments

  • lynxSven
    lynxSven almost 2 years

    I have an Angular 5 project which has many modules and hundreds of components. Since RxJs 6 you have to use

    someObservable.pipe(map(...))
    

    instead of

    someObservable.map(...)
    

    I want to migrate this project from Angular 5 to 6, but dont want to change every occurrence of .map() by hand.

    The Angular update side suggests

    rxjs-5-to-6-migrate -p src/tsconfig.app.json
    

    for migrating to rxjs 6, but I am afraid that this can't change my code.

    Any suggestions on how to save time and change from .map() to .pipe(map()) automatically?