meteor-rxjs icon indicating copy to clipboard operation
meteor-rxjs copied to clipboard

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

Open robport opened this issue 8 years ago • 3 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; https://github.com/angular/angular-cli/issues/7110

robport avatar Nov 08 '17 09:11 robport

Importing from 'rxjs/Observable' will break webSocket functionality

PascalTemel avatar Nov 08 '17 09:11 PascalTemel

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

robport avatar Nov 08 '17 10:11 robport

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

PascalTemel avatar Nov 08 '17 11:11 PascalTemel