Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 1022 Bytes

README.md

File metadata and controls

30 lines (19 loc) · 1022 Bytes

UI5 App Demonstrating Issue with Circular Deps

This repo demonstrates the issue of circular dependencies in TypeScript sources.

The example:

  • App.controller.ts imports file CircularDeps.ts
  • CircularDeps.ts import two dependencies (circular-deps/A.ts & circular-deps/B.ts)
  • both dependencies import each other

Setup

npm install

Shown Error

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'

Problem

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...