Skip to content

Add require and default export conditions - #15

Merged
jorgeraad merged 1 commit into
mainfrom
fix/exports-require-default-condition
Sep 21, 2026
Merged

jorgeraad merged 1 commit into
mainfrom
fix/exports-require-default-condition

Conversation

@jorgeraad

@jorgeraad jorgeraad commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

What was wrong

The exports map exposed only the import condition. A CommonJS consumer, or a bundler resolving in require mode, could not find any entry and failed with ERR_PACKAGE_PATH_NOT_EXPORTED / "cannot find module".

What changed

Added require and default conditions to the . export, both pointing at the existing dist/index.js. The order keeps default last as the catch-all. Version bumped to 0.3.1.

Effect

CommonJS and bundler-in-require-mode consumers resolve the package. ESM consumers are unaffected (the import condition is unchanged). After merge, tag v0.3.1 to publish.

No linked issue.

The package exports map declared only the import condition, so a
CommonJS consumer or a bundler resolving in require mode could not find
an entry and failed with ERR_PACKAGE_PATH_NOT_EXPORTED. It now also
exposes require and default, both pointing at the existing dist/index.js,
so any resolver has an entry to pick. Bumps to 0.3.1 to publish the fix.
jorgeraad added a commit to pensarai/apex that referenced this pull request Sep 21, 2026
0.3.1 adds require and default export conditions so CommonJS and
bundler-in-require-mode consumers can resolve the package
(pensarai/surface#15).
@jorgeraad
jorgeraad merged commit 6d15afb into main Sep 21, 2026
2 checks passed
jorgeraad added a commit to pensarai/apex that referenced this pull request Sep 21, 2026
0.3.1 adds require and default export conditions so CommonJS and
bundler-in-require-mode consumers can resolve the package
(pensarai/surface#15).
jorgeraad added a commit to pensarai/apex that referenced this pull request Sep 21, 2026
0.3.1 adds require and default export conditions so CommonJS and
bundler-in-require-mode consumers can resolve the package
(pensarai/surface#15).
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.

1 participant