Add require and default export conditions - #15
Merged
Merged
Conversation
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
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
The
exportsmap exposed only theimportcondition. A CommonJS consumer, or a bundler resolving inrequiremode, could not find any entry and failed withERR_PACKAGE_PATH_NOT_EXPORTED/ "cannot find module".What changed
Added
requireanddefaultconditions to the.export, both pointing at the existingdist/index.js. The order keepsdefaultlast as the catch-all. Version bumped to0.3.1.Effect
CommonJS and bundler-in-require-mode consumers resolve the package. ESM consumers are unaffected (the
importcondition is unchanged). After merge, tagv0.3.1to publish.No linked issue.