-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Node 14 circular dependency #433
Comments
I just saw this isn't even re right repo i'm sorry. Its the main mongodb repo |
Actually it is a combination from the global jest setup and I created a reproduction repo https://github.com/MrWook/mongodb-memory-server-circular-dependency |
confirmed also happening when upgrading typegoose to but i still have no clue what is causing this, but it dosnt seem to affect anything (yet?) PS: for typegoose it is only happening when upgrading to 7.0 (beta), but not in an 6.x release, @MrWook did it really also happen in 6.9.3 for you? |
update: found an mongoose issue about it: Automattic/mongoose#9900 TL;DR: its an mongodb driver issue, the driver needs to be updated to fix this error |
I get it in 6.9.3 but like i said only when i use it in the jest global setup. It don't break anything on my end either it is just pretty scary to see :D Good thing it is something so simple, i guess it should be in the next mongodb release then |
cant fix for now, because the version where it got fixed in the mongodb driver didnt release yet (and it dosnt seem like they will release it in an minor/patch version) |
237177b should fix this for 6.x |
🎉 This issue has been resolved in version 6.9.6 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 7.0.0-beta.48 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Versions
package: mongo-memory-server
What is the Problem?
We updated from node 12 to Node 14 and a warning is thrown with
Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
Code Example
// jest-global.setup.js
// jest-global.teardown.js
Do you know why it happenes?
This seems like a general problem since node 14 for libraries like nodejs/node#32987
The PR from node to throw this warning is nodejs/node#29935
This means there should be a circular dependency in this library
Here is the whole stacktrace with
node --trace-warnings node_modules/.bin/jest --no-cache someTest.spec.ts
:Which means the circular dependency is in
mongodb/lib/operations/operation.js:4:38
withconst MongoError = require('../core').MongoError;
The text was updated successfully, but these errors were encountered: