-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Mocha ERR_REQUIRE_CYCLE_MODULE on latest CJS #57172
Comments
It looks like there is an open PR in mocha for this mochajs/mocha#5294 I am not quite sure what that PR is doing, it would be more helpful if there is a minimal reproduction. |
I'm not quite sure either, but following the discussion, it sounds like the issue is that these modules are supposed to be not found? mochajs/mocha#5290 (comment) |
I could fix https://github.com/JoshuaKGoldberg/repros/tree/mocha-missing-module-cyclic with #57187 (fix is a funny word, as that graph is supposed to throw MODULE_NOT_FOUND and the fix is just to not shadow the linking error). I don't know if it fixes the regressions specifically reported here if that were tests that would've run fine, but it also includes handling for https://github.com/fisker/prettier-plugin-blade-311 which might have made evaluation that is supposed to proceed not proceed. |
Thanks @joyeecheung for looking into this, I just built your fix here and can confirm your PR resolved this error handler ensuring that the not found error is correctly surfaced to users instead of the cycle error. And to clarify - this only occurs when there is a failure due to a module not found, so on the error paths for tests. The bug thus being an error reporting bug only. |
Version
22.4/23
Platform
Subsystem
modules
What steps will reproduce the bug?
See the upstream issue mochajs/mocha#5290.
With the backport to 22 this is affecting all my Mocha tests.
How often does it reproduce? Is there a required condition?
Unclear of the root cause currently.
What is the expected behavior? Why is that the expected behavior?
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: