Replies: 0 comments 3 replies
-
You may find ES modules more convenient for this kind of loop, as the graph resolution and the module execution are done asynchronously, meaning an |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
Lets say we have 2 node modules that using each other, e.g. :
Module A:
Module B:
So, I did manage to fix it by moving all requires to be after the "module.exports" line, e.g.:
New Module A:
The motivation was to enable both modules first to exist and then require each other and it indeed fixes the issue.
My question is if there are some disadvantages/known issues that I have missed?
Please note that the problematic services(modules) have a lot of functionality.
Also, the require loop can be indirectly(means loop that involves 3 or more modules) so solutions like breaking it into smaller modules won't help me here
Beta Was this translation helpful? Give feedback.
All reactions