Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zkp/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@iden3/js-merkletree": "1.5.1",
"chai": "5.3.3",
"chai": "6.2.2",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The upgrade to Chai v6, an ESM-only library, is incompatible with the project's CommonJS test setup and will cause all tests to fail.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The project is configured as a CommonJS module system, but the chai dependency is being upgraded to v6.2.2. This version of chai is ESM-only and does not support the CommonJS require() syntax used throughout the project's 36 test files. As a result, attempting to run the test suite will cause an ERR_REQUIRE_ESM error, leading to a complete failure of the test pipeline before any tests can be executed.

💡 Suggested Fix

Either revert the chai dependency to a v5.x version which supports CommonJS, or refactor the test suite to use ESM import syntax. The latter would also require adding "type": "module" to package.json or configuring the test runner for ES modules.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: zkp/js/package.json#L21

Potential issue: The project is configured as a CommonJS module system, but the `chai`
dependency is being upgraded to v6.2.2. This version of `chai` is ESM-only and does not
support the CommonJS `require()` syntax used throughout the project's 36 test files. As
a result, attempting to run the test suite will cause an `ERR_REQUIRE_ESM` error,
leading to a complete failure of the test pipeline before any tests can be executed.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 7848328

"circom_tester": "0.0.24",
"circomlibjs": "0.1.7",
"mocha": "11.7.5",
Expand Down
Loading