Skip to content

ESM/CommonJS compatibility issue with chalk@5 and ora@8 #9

@MarcinFrankowski

Description

@MarcinFrankowski

I tried this:

The linter package fails to run due to ESM/CommonJS incompatibility. The package is defined as CommonJS (no "type": "module" in package.json) but uses ESM-only versions of chalk (v5) and ora (v8).

Error

Error [ERR_REQUIRE_ESM]: require() of ES Module chalk not supported.

Reproduction

  1. Install @eventcatalog/linter
  2. Run npx eventcatalog-linter
  3. Error occurs

This happened:

Error occurs instead of linter analysing code.

I expected this:

No response

Is there a workaround?

Downgrade dependencies to their last CommonJS-compatible versions:

  • chalk: 5.x → 4.x
  • ora: 8.x → 5.x

Anything else?

No response

EventCatalog Version

@eventcatalog/core@2.61.6

Node.js Version

v20.15.1

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions