Given:
sap.ui.define([ // in my/ModuleA.js
// "...",
"./ModuleB",
], function (/*...,*/ModuleB) {
// ... ModuleB is undefined here
return/*...*/;
});
sap.ui.define([ // in my/ModuleB.js
// "...",
"./ModuleA"
], function (/*...,*/ModuleA) {
// ... ModuleA is undefined here
return/*...*/;
});
After building and running the application, inspecting the generated Component-preload.js shows that the ModuleB parameter in my/ModuleA.js or the ModuleA parameter in my/ModuleB.js is undefined.
It's easy to detect such cyclic dependencies in a small project. But how can I detect such flaws easily if there are multiple modules and their dependencies are complex?