Recently, I decided to migrate a big project that has been created from scratch with the "Quick Start" of Angular to a version using Angular CLI 1.5.5. Right now, I'm fixing the different issues that arise and I can't get to fix this one.
I read that it was better to use lettable operators of rxjs, which I did and it works very well. However, I also have these lines of code:
import { Observable } from "rxjs/Observable";
import "rxjs/add/observable/forkjoin";
...
let piecesGrouping$: Observable<IGroupedPiece[]>[] = deliveries.map(delivery => this._pieceService.getGroupedPieces(delivery.pieces));
Observable
.forkJoin(...piecesGrouping$)
.subscribe((groups) => {
groups.forEach((group, i) => deliveries[i].groupedPieces = group);
resolve();
});
They were working very well in the previous version that was using rxjs 5.4.3, now with rxjs 5.5.2, they don't anymore and I get the following error:
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'apply' of undefined TypeError: Cannot read property 'apply' of undefined
I tried to replace the spread operator by piecesGrouping$[0], piecesGrouping$[1]
as the error does not say anything about forkJoin
in itself, then I get:
ERROR Error: Uncaught (in promise): TypeError: WEBPACK_IMPORTED_MODULE_8_rxjs_Observable.a.forkJoin is not a function TypeError: WEBPACK_IMPORTED_MODULE_8_rxjs_Observable.a.forkJoin is not a function
So it looks like that I'm importing forkJoin
the wrong way. I tried to import it from "rxjs/observable/forkJoin" but it didn't work either.
What am I missing?