I am getting the error, "ReferenceError: Cannot access 'ConversationService' before initialization" when trying to inject a service. I have solved many circular dependency issues in the past but this has me stumped. I even used https://github.com/jmcdo29/nestjs-spelunker to pull the dependency graph and has very carefully gone over it several times and can't find any circular dependencies. forwardRef also doesn't not fix it. Can anyone suggest tools to help track it down or could there be a non-circular dependency issue causing this?
#Suggestion for tools to track down circular dependencies?
6 messages · Page 1 of 1 (latest)
You may want to look at madge as it can also help determine circular dependencies
Or dependency-cruiser which is my personal preference
Oh, that looks way better! Thanks for the recommendation
those both seem to be focused on js import dependencies rather than nestjs injection dependencies. It had not occured to me that could be causing it
That did it! Thank you so much. Had an import that was just bringing a const from a service. Since the service wasn't instantiated it wasn't part of the dependency inject system. So lesson is need to remember to pay attention to both nestjs dependency circulars and regular js circulars!