This repo demonstrates the issue of circular dependencies in TypeScript sources.
The example:
App.controller.ts
imports fileCircularDeps.ts
CircularDeps.ts
import two dependencies (circular-deps/A.ts
&circular-deps/B.ts
)- both dependencies import each other
npm install
When starting the server (npm run start
) or
Failed to load component for container __container0 - ModuleError: Failed to resolve dependencies of 'org/odata2ts/trippin/App.controller.js'
-> 'org/odata2ts/trippin/CircularDeps.js'
-> 'org/odata2ts/trippin/circular-deps/B.js': failed to execute module factory for ''org/odata2ts/trippin/circular-deps/B.js'': ___A is undefined
ModuleError: Failed to resolve dependencies of 'org/odata2ts/trippin/App.controller.js'
sap.ui.define
cannot handle circular dependencies and will provide one of the dependencies as undefined
.
sap.ui.require
should be able to cope with that...