You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: