The error "Module has no exported member" occurs when we try to import a member that doesn't exist in the specified module. To solve the error, make sure the module exports the specific member and you haven't mistyped the name or mistaken named for default import.
To solve the error "Module not found: Error: Can't resolve 'rxjs'", make sure to install the rxjs package by opening your terminal in your project's root directory and running the command npm install rxjs and restart your development server.
The of Operator is a creation Operator. Creation Operators are functions that create an Observable stream from a source. The of Operator will create an Observable that emits a variable amount of values in sequence, followed by a Completion notification.
This might be helpful in Angular 6 for more info refer this Document
import { Observable, Subject, asapScheduler, pipe, of, from, interval, merge, fromEvent } from 'rxjs';
import { map, filter, scan } from 'rxjs/operators';
import { webSocket } from 'rxjs/webSocket';
import { ajax } from 'rxjs/ajax';
import { TestScheduler } from 'rxjs/testing';
Apparently (as you point in the error log), after updating to Angular 6.0.0 rxjs-compat is missing.
Run npm install rxjs-compat --save
to install. Should fix it.
Just put:
import { Observable} from 'rxjs';
Just like that. Nothing more or less.
I replaced the original code with import { Observable, of } from 'rxjs'
, and the problem is solved.
You are using RxJS 6. Just replace
import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
by
import { Observable, of } from 'rxjs';
Try this:
npm install rxjs-compat --save
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With