microsoft / beachball

The Sunniest Semantic Version Bumper

Home Page:https://microsoft.github.io/beachball

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ESM support?

vovsemenv opened this issue · comments

reporpduce:

  1. add "type": "module" to package.json
  2. npm i -D beachball
  3. create beachball.config.js file
  4. npx beachball check
An error has been detected while running beachball!
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/vladimirsemenov/qameta/allure3/beachball.config.js from /Users/vladimirsemenov/qameta/allure3/node_modules/cosmiconfig/dist/loaders.js not supported.
Instead change the require of beachball.config.js in /Users/vladimirsemenov/qameta/allure3/node_modules/cosmiconfig/dist/loaders.js to a dynamic import() which is available in all CommonJS modules.

I think you'd need to either change the filename to beachball.config.cjs, or change the config file to do export default { /*contents*/ } instead of module.exports = { /*contents*/ }.

Yes, i guess we need to note that in the docs