uber / needle

Compile-time safe Swift dependency injection framework
Apache License 2.0
1.84k stars 144 forks source link

Getting double results #438

Open alexvbush opened 2 years ago

alexvbush commented 2 years ago

Seems like I'm getting double results when Needle identifies missing dependencies.

ios % needle generate upkeep/NeedleGenerated.swift Source
warning: ❗️ Could not find a provider for (userDefaults: UserDefaults) which was required by NotificationHubMenuDependency, along the DI branch of ^->AppDependencies->NotificationHubComponent->NotificationHubMenuComponent.
warning: ❗️ Could not find a provider for (userDefaults: UserDefaults) which was required by NotificationHubMenuDependency, along the DI branch of ^->AppDependencies->NotificationHubComponent->NotificationHubMenuComponent.
warning: ❗️ Missing one or more dependencies at scope.
error: 💩 Some dependencies are missing, please look at the warnings above for the list.

Is this expected or am I configuring something wrong?

irfanabdulkhaliq commented 9 months ago

Hi @alexvbush I am facing same issue please let me know how you solved the issues. I have been stuck here for 5 days.

alexvbush commented 8 months ago

@irfanabdulkhaliq, haven't resolved yet, although we're still on the older version of needle, not sure if it got fixed lately. At the end of the day it's not a big issue because when you resolve all the missing dependencies it goes away and if you have any, well, then it will just show up twice in your results.

kaaaaai commented 6 months ago

Did you solve the problem?

kaaaaai commented 6 months ago

@alexvbush @irfanabdulkhaliq I got it, it could be due to this update. image

If you display

warning: ❗️ Along the DI branch of ^->AppDependencies->NotificationHubComponent->NotificationHubMenuComponent, the NotificationHubMenuDependency required ( userDefaults: UserDefaults) provider.

Trying to make the NotificationHubMenuDependency's inherited class public might solve the problem!