There is some problem in your imports. To understand this error:
Suppose there are two files a.ts and b.ts
a.ts
import { b } from './b';
export function a() {
console.log('function: a');
}
b();
b.ts
import { a } from './a';
export function b() {
a();
console.log('function: b');
}
here we can see that file a.ts depends on b.ts and file b.ts depends on a.ts, so it creates a cycle to load which file first!
It is a very simple example, but it could be a very long cycle in complex file structure!
Above problem can be solved by many ways:
- simply moving any of the above function to same file hence avoiding the import problem
- separating the function call logic in a.ts to a new file c.ts and import both functions there etc.
there may be more solutions also.
generally what people do, import all component file to an index file of that directory and re-export it from there, this the point where problem begins.
Your problem is a perfect example of this situation, to avoid such problems you should import your dependencies directly from that original file not from index file to avoid a cycle.
Still problem may persist, to further solve it find out common dependency and take it to separate file and then import it to all dependent files.