Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular dependency error #9

Open
Likhitha-03 opened this issue Aug 22, 2024 · 0 comments
Open

Circular dependency error #9

Likhitha-03 opened this issue Aug 22, 2024 · 0 comments

Comments

@Likhitha-03
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant