Questions tagged [cyclic-dependency]

Cyclic Dependency occurs when objects form an infinite recurring dependency graph. The head points to the tail and the tail points to the head.

123 questions
3
votes
1 answer

ES6: self-import vs ordering exports for referencing

I have a single file that has utils methods. Each is exported individually. I am in a situation where one util requires another. I currently define the functions used before they're used. But I came across ES6's cyclic dependency and using that…
Struggler
  • 672
  • 2
  • 9
  • 22
3
votes
2 answers

C++: How to solve template cyclic dependency between derived classes when two classes contain a pointer pointing to another?

I have a parent class and some classes derived from it. I want to 'pair' two derived classes that eac has a pointer to another one. Code example: template class Parent { // some stuff DerivedClassName*…
A lucky ant
  • 109
  • 1
  • 8
3
votes
0 answers

Dagger gives Cyclic dependency when using recommended architecture

I want to build an android app using the suggested architecture here. However after following the guide and using dagger for all my classes I ended up with a cyclic dependency summarised as android.app.Application <- (Retrofit) ServerClient <-…
3
votes
1 answer

Problem with cyclic dependencies between types and functions from different files in F#

My current project uses AST with 40 different types (discriminated unions) and several types from this AST has cyclic dependency. The types are not so big, therefore I put them in one file and applied type ... and ... construction for mutually…
Vitaliy
  • 2,744
  • 1
  • 24
  • 39
3
votes
2 answers

Angular 5 APP_INITIALIZER causes Cylic Dependency

similar to Angular 5 APP_INITIALIZER gives Cyclic dependency error I have an app which uses Angular 5 and SSR, I have just upgraded it all from Angular 4 where all was well. Now when I use the APP_INITIALIZER I get the above mentioned error. I…
Mark Perry
  • 2,908
  • 3
  • 18
  • 27
3
votes
0 answers

cyclic dependency. HttpInterceptor and TranslateService

This is discussed a lot, but I can't find how to solve my issue. The reason is clear, I'm trying to use translateService in my interceptor, but both depends on httpClient. I only happens when my interceptor constructor is: constructor( …
2
votes
2 answers

Calling member method of cyclic dependent classes

I'm trying to setup a simulation program. The simulation runs for a number of steps, and the simulation class should call ::step() of a bunch of different classes, one of them is the _experiment class. I cannot get this to work, because the…
2
votes
1 answer

Should I refrain from circular imports when using typescript?

I just spent 4 hours troubleshooting typescript error Object literal may only specify known properties, and 'details' does not exist in type 'Readonly<{ [x: `details.${string}.value`]: { value: string; type: string; } | undefined; [x:…
2
votes
3 answers

Avoiding circular imports for the 100th time

Summary I keep on having an ImportError in a complex project. I've distilled it to the bare minimum that still gives the error. Example A wizard has containers with green and brown potions. These can be added together, resulting in new potions that…
ElRudi
  • 2,122
  • 2
  • 18
  • 33
2
votes
1 answer

Dealing with cyclic dependencies of percentage sized boxes css (specifically how to get a max-height)

First shortly, this is a follow up question to Problem with max-height not working in css grid element where I misunderstood my problem and I would have had to completely rewrite it, so I'm starting a new one, I hope that is fine. My goal in one…
apaierubkf
  • 55
  • 5
2
votes
2 answers

How do you fix this circular dependency issue in node

` I'm getting errors such as Type variable is undefined and getLastUnknownAlbumTrackNumber is not a function I installed madge to check circular dependencies but I dont know how to resolve them following is the output from madge const madge =…
2
votes
1 answer

Two classes friending a member function from the other class

I've been trying to find a way to have two classes, where each class has a member function, and each member function is a friend of the other class. To illustrate: #include class A; class B { friend void A::func_A(); // compiler…
Bwyan Eh
  • 23
  • 3
2
votes
1 answer

c++ creating cyclically dependent objects with raw pointers

I'm trying to create a connected graph and to perform certain computations on it. To do that, from each node in this graph, I need to access its neighbors and to access its neighbor's neighbors from its neighbor and so forth. This inevitably creates…
2
votes
1 answer

How to get, resolve and verify transitive/cyclic dependency

I need some custom way to resolve variable which might have transitive and verify cyclic/un-resolvable fields. e.g. var v1 = 'asd'; var v2 = '@@{v1}@@'; var v3 = '@@{v2}@@'; var v4 = '@@{v3}@@'; var v5 = '@@{v4}@@'; var v6 =…
Akhilesh Kumar
  • 9,085
  • 13
  • 57
  • 95
2
votes
0 answers

Avoiding cyclic overload and specialization dependencies in library (AKA manual C++ export method)

There are times when I want to overload or specialize templates that are already called earlier due to cyclic dependencies. As they're templates, the solution is usually to split the declaration and the definition. However, if these templates are…
xaxazak
  • 748
  • 4
  • 16
1 2
3
8 9