Skip to content

chore(deps): ignore mocha major versions - #414

Merged
szegedi merged 1 commit into
mainfrom
ignore-mocha-major
Sep 16, 2026
Merged

szegedi merged 1 commit into
mainfrom
ignore-mocha-major

Conversation

@szegedi

@szegedi szegedi commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

mocha 12 is ESM-only ("type": "module") and declares engines: ^20.19.0 || >=22.12.0. Its lib/cli/options.cjs does require("./parse-args.js"), an ES module, which only works via Node's require(esm) support — unflagged in 20.19+ and 22.12+, absent in 18.

Since we still build and test on Node 18, every Node 18 job in #413 failed with:

Error [ERR_REQUIRE_ESM]: require() of ES Module .../mocha/lib/cli/parse-args.js
from .../mocha/lib/cli/options.cjs not supported.

Node 20/22/24/25/26 pass; the failures are exclusively the (18) matrix entries.

So: stay on mocha 11 (engines: ^18.18.0 || ^20.9.0 || >=21.1.0) and ignore major bumps until we drop Node 18, mirroring the existing typescript clause in the same file.

We need to keep support for Node.js 18 until April 2027, when dd-trace-js v5.x reaches EOL.

mocha 12 is ESM-only and requires Node ^20.19 || >=22.12. Its
lib/cli/options.cjs require()s parse-args.js, an ES module, which
only works via Node's require(esm) support — unflagged in 20.19+ and
22.12+, absent in 18. Since we still build and test on Node 18, every
Node 18 job in #413 failed with ERR_REQUIRE_ESM.

Stay on mocha 11 (which supports ^18.18.0 || ^20.9.0 || >=21.1.0) and
ignore major bumps until we drop Node 18, mirroring the existing
typescript clause.
@github-actions

Copy link
Copy Markdown

Overall package size

Self size: 2.62 MB
Deduped: 3.32 MB
No deduping: 3.32 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | pprof-format | 2.3.1 | 504.33 kB | 504.33 kB | | source-map | 0.8.0 | 185.66 kB | 185.66 kB | | node-gyp-build | 4.8.4 | 13.86 kB | 13.86 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@szegedi szegedi added the semver-patch Bug or security fixes, mainly label Sep 16, 2026
@datadog-prod-us1-5

This comment has been minimized.

@szegedi
szegedi merged commit a5e364a into main Sep 16, 2026
125 of 129 checks passed
@szegedi
szegedi deleted the ignore-mocha-major branch September 16, 2026 12:50
@szegedi szegedi mentioned this pull request Oct 6, 2026
szegedi added a commit that referenced this pull request Oct 7, 2026
mocha 12 is ESM-only and requires Node ^20.19 || >=22.12. Its
lib/cli/options.cjs require()s parse-args.js, an ES module, which
only works via Node's require(esm) support — unflagged in 20.19+ and
22.12+, absent in 18. Since we still build and test on Node 18, every
Node 18 job in #413 failed with ERR_REQUIRE_ESM.

Stay on mocha 11 (which supports ^18.18.0 || ^20.9.0 || >=21.1.0) and
ignore major bumps until we drop Node 18, mirroring the existing
typescript clause.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch Bug or security fixes, mainly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants