1
votes

I'm following this tutorial for RxJS but When I get to the part of setting up env, I get an error message when doing

$yarn run start

import * as Rx from "rxjs/Observable";
console.log(Rx);

if I leave the log without the "Rx", it shows fine. But if I use the log... I get this error:

ERROR in ./node_modules/rxjs/Observable.js Module not found: Error: Can't resolve 'rxjs-compat/Observable' in '/Users/manuel/Documents/testeos/JS/rxjs/node_modules/rxjs' @ ./node_modules/rxjs/Observable.js 6:9-42 @ ./src/code.ts @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/code.ts

1
Did you run npm install? - Syed Shoaib Abidi
@ShoaibRaza yes thanks, yarn - manuelBetancurt
Can you try to add rxjs-compat module - yarn add rxjs-compat? - m1ch4ls

1 Answers

2
votes

I ran into the same issue today

Install yarn add rxjs-compat / npm install rxjs-compat

or

Do don't use deprecated imports: rxjs/Rx, rxjs/Observable, etc... (see new import paths)