Skip to content

Fix ClientError native ESM import#90

Open
omribz156 wants to merge 1 commit into
mondaycom:mainfrom
omribz156:codex/fix-clienterror-esm-export
Open

Fix ClientError native ESM import#90
omribz156 wants to merge 1 commit into
mondaycom:mainfrom
omribz156:codex/fix-clienterror-esm-export

Conversation

@omribz156
Copy link
Copy Markdown

Summary

  • add conditional package exports for @mondaydotcomorg/api
  • route native Node ESM imports to an .mjs build output, while keeping the existing .js ESM bundle and CJS entry
  • expose ./package.json through the exports map

Fixes #89.

Verification

  • corepack yarn install --frozen-lockfile
  • corepack yarn workspace @mondaydotcomorg/api build
  • npx -y node@18 --input-type=module -e "import { ClientError } from '@mondaydotcomorg/api'; console.log(ClientError.name);"
  • node --input-type=module -e "import { ClientError } from '@mondaydotcomorg/api'; console.log(ClientError.name);"
  • node -e "const { ClientError } = require('@mondaydotcomorg/api'); console.log(ClientError.name);"
  • corepack yarn workspace @mondaydotcomorg/api test --runInBand
  • ./node_modules/.bin/prettier.cmd --check packages/api/package.json packages/api/rollup.config.js
  • git diff --check -- packages/api/package.json packages/api/rollup.config.js

Implemented with Codex assistance; I kept the patch focused and manually verified the package-name import path that fails in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClientError named import fails under Node native ESM (getter-based CJS re-export not detected by cjs-module-lexer)

1 participant