Search code examples
angularrxjsreactivex

Angular 4: Module not found error regarding RxJs


when building the Angular app I get many of these errors, below is just the first one

ERROR in ./~/@reactivex/rxjs/dist/cjs/Rx.js
Module not found: Error: Can't resolve './add/operator/filter' in 
'...\node_modules\@reactivex\rxjs\dist\cjs'
 @ ./~/@reactivex/rxjs/dist/cjs/Rx.js 70:0-32
 @ ./~/@reactivex/rxjs/index.js
 @ ./~/ri-api-client/dist/index.js
 @ ./src/app/core/api.service.ts
 @ ./src/$$_gendir/app/app.module.ngfactory.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

what am I missing?


Solution

  • Based on your error message it seems that your import statement is not correct. It complains about not finding things in node_modules/@reactivex, but it should be looking in node_modules/rxjs.

    Your import statement should look like this:

    import 'rxjs/add/operator/filter';