Observable.fromEvent is not a function

ERROR Error: Uncaught (in promise): TypeError: WEBPACK_IMPORTED_MODULE_2_rxjs_Observable.Observable.fromEvent is not a function
TypeError: WEBPACK_IMPORTED_MODULE_2_rxjs_Observable.Observable.fromEvent is not a function
at new SuperTabs (super-tabs.js:136)

My rxjs version is :

“rxjs”: “^6.3.2”,
“rxjs-compat”: “^6.3.2”

I have modified super-tabs.d.ts and super-tabs.js with following imports

import { Observable } from ‘rxjs/Observable’;
import ‘rxjs/add/observable/fromEvent’;

But still gets the same error.

Is there any other solution ??

Other Configurations:
Ionic Framework: 3.9.2
Ionic App Scripts: 3.2.4
Angular Core: 5.2.10
Angular Compiler CLI: 5.2.10
Node: 15.4.0
OS Platform: Linux 5.4
Navigator Platform: Linux x86_64

The correct import should be

import { fromEvent } from ‘rxjs/Observable’;

So you use it like

// RxJS v6+
import { fromEvent } from 'rxjs';
import { map } from 'rxjs/operators';

//create observable that emits click events
const source = fromEvent(document, 'click');
//map to string with given event timestamp
const example = source.pipe(map(event => `Event time: ${event.timeStamp}`));
//output (example): 'Event time: 7276.390000000001'
const subscribe = example.subscribe(val => console.log(val));

You can check the official document RxJS (fromEvent)

@shseah601 Thanks a lot, it worked…