Skip to content

🐛 Bug: Can't import custom ESM interfaces and reporters #5562

@Lightning00Blade

Description

@Lightning00Blade

Bug Report Checklist

  • I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
  • I have searched for related issues and issues with the faq label, but none matched my issue.
  • I have 'smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, my usage of Mocha, or Mocha itself.
  • I want to provide a PR to resolve this

Expected

Using a ESM module for reporter or interface and export default works

Actual

Mocha returns Error: null (#5078)

Minimal, Reproducible Example

In the following gist - #5078
Using them via the CLI should yield the correct errors.

Versions

Mocha v11.7.5
Node v24

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: in triagea maintainer should (re-)triage (review) this issuetype: buga defect, confirmed by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions