Class extends value undefined is not a constructor or null [ng] TypeError: Class extends value undefined is not a constructor or null

I am new to this forum. I hope to get a resolution to the below issue i am facing after installing capacitor. It seems like this issue has multiple flavors and kind of related to circular dependencies. But i could not see where the circular dependency is happening in my code. Therefore I am posting the log here and hoping that someone might see a hint.

Class extends value undefined is not a constructor or null

[ng] TypeError: Class extends value undefined is not a constructor or null

[ng] at Object. (D:\projects\myproject\node_modules@ionic\angular-toolkit\builders\cordova-serve\index.js:30:52)

[ng] at Module._compile (internal/modules/cjs/loader.js:689:30)

[ng] at Object.Module._extensions…js (internal/modules/cjs/loader.js:700:10)

[ng] at Module.load (internal/modules/cjs/loader.js:599:32)

[ng] at tryModuleLoad (internal/modules/cjs/loader.js:538:12)

[ng] at Function.Module._load (internal/modules/cjs/loader.js:530:3)

[ng] at Module.require (internal/modules/cjs/loader.js:637:17)

[ng] at require (internal/modules/cjs/helpers.js:22:18)

[ng] at Architect.getBuilder (D:\projects\myproject\node_modules@angular-devkit\architect\src\architect.js:189:35)

[ng] at MapSubscriber.getBuilderDescription.pipe.operators_1.map [as project] (D:\projects\myproject\node_modules@angular-devkit\architect\src\architect.js:121:332)

[ng] at MapSubscriber._next (D:\projects\myproject\node_modules\rxjs\internal\operators\map.js:49:35)

[ng] at MapSubscriber.Subscriber.next (D:\projects\myproject\node_modules\rxjs\internal\Subscriber.js:67:18)

[ng] at TapSubscriber._next (D:\projects\myproject\node_modules\rxjs\internal\operators\tap.js:65:26)

[ng] at TapSubscriber.Subscriber.next (D:\projects\myproject\node_modules\rxjs\internal\Subscriber.js:67:18)

[ng] at MergeMapSubscriber.notifyNext (D:\projects\myproject\node_modules\rxjs\internal\operators\mergeMap.js:92:26)

[ng] at InnerSubscriber._next (D:\projects\myproject\node_modules\rxjs\internal\InnerSubscriber.js:28:21)