Skip to content

Error [ERR_REQUIRE_ESM]. Compatibility error causing by new version of @hubspot/cli-lib.  #42

Description

@dmh

We use @hubspot/cli-lib as an dependency in our internal tool to interact with HubSpot's public APIs. Up to @hubspot/cli-lib v7.0.0 everything works fine without any problems, but starting with @hubspot/cli-lib v8.0.0 everything stops working with this error :

Error [ERR_REQUIRE_ESM]: require() of ES Module …node_modules/@hubspot/local-dev-lib/lib/… not supported


Simplest way to reproduce the error:

  1. Create a simple node project
  2. Install @hubspot/cli-lib as an npm dependency
  3. Create a check.js file
  4. Add this line to the file: import { downloadFileOrFolder } from '@hubspot/cli-lib/fileMapper.js'
  5. Run code node check.js twice with @hubspot/cli-lib v5.0.1 and v8.0.0 as an dependency
  1. Works great with v5.0.1
  2. With version 8.0.0 we'll get an error

Tested with Node.js v18 and v20


Thanks in advance.

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