Skip to content

maintenance: get ready for esm/mjs #71

@antongolub

Description

@antongolub

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[multi-semantic-release]: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/runner/work/semantic-release-toolkit/semantic-release-toolkit/node_modules/file-url/index.js
require() of ES modules is not supported.
require() of /home/runner/work/semantic-release-toolkit/semantic-release-toolkit/node_modules/file-url/index.js from /home/runner/work/semantic-release-toolkit/semantic-release-toolkit/packages/common/target/es5/git/init.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/runner/work/semantic-release-toolkit/semantic-release-toolkit/node_modules/file-url/package.json.

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