Error when running pnpm test #34

Open
opened 2025-05-14 12:55:33 +00:00 by josdejong · 1 comment
Collaborator

When I run pnpm test, I get the following error:

 Exception during run: Error [ERR_REQUIRE_CYCLE_MODULE]: Cannot require() ES Module C:[...]\nanomath\src\__test__\numbers.spec.js in a cycle. (from C:[...]\nanomath\node_modules\.pnpm\mocha@11.1.0\node_modules\mocha\lib\nodejs\esm-utils.js)

Any idea why this error happens? Can it be related to usage of pnpm and package.json5 or so (pnpm often gives me trouble)? Or just mocha issues? I've had troubles with mocha related to CommonJS/ESM before, and I'm mostly using vitest nowadays.

When I run `pnpm test`, I get the following error: ``` Exception during run: Error [ERR_REQUIRE_CYCLE_MODULE]: Cannot require() ES Module C:[...]\nanomath\src\__test__\numbers.spec.js in a cycle. (from C:[...]\nanomath\node_modules\.pnpm\mocha@11.1.0\node_modules\mocha\lib\nodejs\esm-utils.js) ``` Any idea why this error happens? Can it be related to usage of pnpm and `package.json5` or so (pnpm often gives me trouble)? Or just mocha issues? I've had troubles with mocha related to CommonJS/ESM before, and I'm mostly using vitest nowadays.
Owner

Well, it could just be that there is a cyclic inclusion in this test. Certainly nanomath early on had trouble with cyclic inclusion. I have a tool that checks for it. I will take a look.

Well, it could just be that there is a cyclic inclusion in this test. Certainly nanomath early on had trouble with cyclic inclusion. I have a tool that checks for it. I will take a look.
glen added the
priority
maintenance
labels 2025-05-15 13:21:20 +00:00
glen self-assigned this 2025-05-15 13:21:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: StudioInfinity/nanomath#34
No description provided.