-2

I tried to upgrade my project fron Angular 5.2 to 6 using the instructions at https://update.angular.io/

After upgrade, when I build the project (ng build), I keep getting below error

/node_modules/rxjs/Observable"' has no exported member 'Observable'.

I referred to the observable in my code as

import { Observable } from 'rxjs'

Do I need to do anything else?

Rohit Ramname
  • 824
  • 2
  • 9
  • 24
  • 1
    Make sure that you’re using rxjs 6 in your project. You may also want to import Observable from ˋrxjs/Observable` so you won’t import the whole library. – Marouane Fazouane May 04 '18 at 17:06

2 Answers2

0

That should be all you need to do for the Observable class, but the error message strongly suggests you haven't updated all the import paths. I would double check to see if you forgot one, because

/node_modules/rxjs/Observable"

Means its still looking in 'rxjs/Observable' which was the old import path

diopside
  • 2,981
  • 11
  • 23
0

I use this in 6.4

import { Observable } from "rxjs/Observable";

version

  "rxjs": "^6.4.0",
  "rxjs-compat": "^6.0.0-rc.0",
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
AliWieckowicz
  • 549
  • 1
  • 4
  • 17