Upgrading to Angular 10 - Fix CommonJS or AMD dependencies can cause optimization bailouts

Ora picture Ora · Jun 26, 2020 · Viewed 37.5k times · Source

I am trying to upgrade my angular 9 app to angular 10 version, but getting below warning after the upgrade

rxjs\BehaviorSubject.js depends on rxjs-compat/BehaviorSubject

Any idea how to fix this?

Thanks in advance!

Answer

Janardhan Burle picture Janardhan Burle · Jul 14, 2020

try replacing the rxjs imports rxjs/internal/operators with rxjs/operators.

ex:

import { catchError, retry } from 'rxjs/internal/operators';

with

import { catchError, retry } from 'rxjs/operators';