Urigo / meteor-rxjs

Exposing Mongo Cursor as RxJS Observable
MIT License
120 stars 38 forks source link

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

Open robport opened 7 years ago

robport commented 7 years ago

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; https://github.com/angular/angular-cli/issues/7110

PascalTemel commented 7 years ago

Importing from 'rxjs/Observable' will break webSocket functionality

robport commented 7 years ago

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..."

PascalTemel commented 7 years ago

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