Cannot find module 'rxjs-compat/Observable'

前端 未结 12 1410
孤街浪徒
孤街浪徒 2020-12-08 06:54

I am currently upgrading angular 4 to angular 6 code. I have installed \"rxjs\": \"^6.3.2\" and un-installed rxjs-compact as I have migrated the code to use the new rxjs ope

12条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 07:20

    None of these answers are correct. Installing rxjs-compat is just a workaround. All you have to do is correct the imports. Use:

    import { Observable } from 'rxjs';
    

    Instead of:

    import { Observable } from 'rxjs/Observable';
    

    This last import is supposed to go away when they finally decide to kill rxjs-compat (hopefully very soon)... so heads up! you need to update your code!!

提交回复
热议问题