Urigo / meteor-rxjs

Exposing Mongo Cursor as RxJS Observable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERROR in ./node_modules/rxjs/observable/BoundCallbackObservable.js

robport opened this issue · comments

I get this error when building in Angular 5.0 with Angular CLI 1.5 using --prod flag.

The issue is misaligned Observable and Subject import in MeteorObservable.js, ObservableCursor.js, and zone.js and ObservableCollection.js

Change imports to;

import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { Subscriber } from 'rxjs/Subscriber';

Seen here; angular/angular-cli#7110

Importing from 'rxjs/Observable' will break webSocket functionality

Odd, because it seems to work. How will it break it?

If I don't maek these changes, I cannot do "ng build --prod" because I get "ERROR in ./node_modules/rxjs/observable/BoundCallbackObservable.js..."

I know about the error and your fix does help, but if you want to use Observable.webSocket, importing from rxjs/Observable does not work. It SHOULD behave the same way as it does when you import from rxjs/Rx, but for some reason it doesn't.

I fixed the issue I had by upgrading to typescript 2.6.1. The production build will work with that typescript version, even if you import from rxjs/Rx