0

When running my angular application after compiling it with --prod, I often get some XXX is not a function errors.

They are usually caused by some missing augmentations on Observable (I am using RxJS 5). They are fixed by adding the correct import 'rxjs/add/operator/XXXX'; in the correct file, after finding this 'correct file' which can be long. And then are I have to rebuild the application, re-test and fix the next similar error.

(see Angular HTTP GET with TypeScript error http.get(...).map is not a function in [null] for similar problems)

My question : is there a way to detect all the missing augmentation imports ?

Eventually using Webstorm, angular-cli, a good combination of find/grep/awk or any other tool.

Benoît
  • 1,080
  • 11
  • 28
  • Use pipeable operators. That's one of the main reasons they have replaced the old operators (which don't exist anymore in RXJS6, and thus Angular 6). The Angular 6 update procedure will do that automatically for you. – JB Nizet Jul 11 '18 at 09:53
  • I know it is the way to go, but we would prefer to postpone a few month this upgrade to RxJs6/Angular6. And it will solve 99% of these missing augmentations import problems – Benoît Jul 11 '18 at 13:24

0 Answers0