From 2ad58bfeb888d098b7d948f65dd8af820d1c3e46 Mon Sep 17 00:00:00 2001 From: Khaliq Date: Wed, 15 Apr 2026 10:51:10 +0200 Subject: [PATCH] fix(pkg): add default condition to exports for CJS resolvers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The exports map declared only `types` and `import` conditions, which made CJS resolution fail with ERR_PACKAGE_PATH_NOT_EXPORTED when a CJS caller (or a tooling path-walker like tsx's resolveTsPaths) landed on the package. Adding a `default` condition pointing at the same ESM entry lets Node's CJS resolver find a match and then fail at load time with a clearer ESM-interop error instead of a misleading "no exports main defined". Functionally this does not make the package dual-mode — it's still `type: module` and the dist is ESM — but it closes the CJS resolution gap that was breaking downstream tsx users. Co-Authored-By: Claude Opus 4.6 (1M context) --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 76081f5..f1d11a9 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,13 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.js" + "import": "./dist/index.js", + "default": "./dist/index.js" }, "./sdk": { "types": "./dist/sdk/index.d.ts", - "import": "./dist/sdk/index.js" + "import": "./dist/sdk/index.js", + "default": "./dist/sdk/index.js" } }, "bin": {