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
npm i rxjs-compat
It's working for me.
Just open command prompt & add below command in to your root folder.
npm i rxjs-compat
Hope it's working ..
import { Observable } from 'rxjs';
this will be enough, there's no need for other imports
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!!
This will solve the issue:
npm install --save rxjs-compat
See this GitHub issue
Edit : as per 10th October 2019 ,you can use below syntax as the earlier or the above one was a workaround.
import { Observable } from 'rxjs/Observable';
Reference doc: https://github.com/ReactiveX/rxjs/blob/master/docs_app/content/guide/v6/migration.md#dropping-the-compatibility-layer
Both the rxjs and rxjs-compat of the version 6.3.2 worked for me.
npm install rxjs@6.3.2 --save && npm install rxjs-compat@6.3.2 --save