-
Notifications
You must be signed in to change notification settings - Fork 107
Description
I am getting circular dependency error while containerizing this project
Causes:
Product.model.js relies on mongoose.
Product.Controller.js depends on Product.model.js.
app.js requires initDB.js, which in turn requires mongoose again, but mongoose is indirectly used in Product.model.js.
Errors:
(node:16732) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:16732) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:16732) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:16732) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency