Skip to content

Commit 2ad58bf

Browse files
khaliqgantclaude
andcommitted
fix(pkg): add default condition to exports for CJS resolvers
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) <noreply@anthropic.com>
1 parent 9afb101 commit 2ad58bf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
"exports": {
99
".": {
1010
"types": "./dist/index.d.ts",
11-
"import": "./dist/index.js"
11+
"import": "./dist/index.js",
12+
"default": "./dist/index.js"
1213
},
1314
"./sdk": {
1415
"types": "./dist/sdk/index.d.ts",
15-
"import": "./dist/sdk/index.js"
16+
"import": "./dist/sdk/index.js",
17+
"default": "./dist/sdk/index.js"
1618
}
1719
},
1820
"bin": {

0 commit comments

Comments
 (0)