Skip to content

Fix TypeScript subpath exports resolution under node moduleResolution#116

Merged
JSv4 merged 1 commit intomainfrom
claude/investigate-issue-113-9WMfq
Mar 21, 2026
Merged

Fix TypeScript subpath exports resolution under node moduleResolution#116
JSv4 merged 1 commit intomainfrom
claude/investigate-issue-113-9WMfq

Conversation

@JSv4
Copy link
Copy Markdown
Owner

@JSv4 JSv4 commented Mar 21, 2026

Summary

Fixed TypeScript subpath exports (docxodus/react and docxodus/worker) not resolving correctly under moduleResolution: "node" by adding a typesVersions fallback configuration to package.json.

Changes

  • Reordered export conditions: Moved types field before import in all export entries (., ./react, ./worker) to comply with TypeScript's requirement that type conditions appear first
  • Added typesVersions fallback: Introduced typesVersions configuration mapping subpath exports to their corresponding .d.ts files, ensuring type resolution works under all TypeScript module resolution modes (node, bundler, etc.)

Details

The typesVersions field acts as a fallback for TypeScript versions that don't fully support the conditional exports syntax, allowing subpath imports like import type { ... } from 'docxodus/react' to correctly resolve their type definitions regardless of the consumer's moduleResolution setting.

https://claude.ai/code/session_01DFuL5c7KNRiu4QgifBBGWV

Add typesVersions fallback to package.json so docxodus/react and
docxodus/worker resolve types under all TS module resolution modes.
Reorder export conditions to put types before import per TS requirements.

https://claude.ai/code/session_01DFuL5c7KNRiu4QgifBBGWV
@JSv4 JSv4 merged commit 015af43 into main Mar 21, 2026
10 checks passed
@JSv4 JSv4 linked an issue Mar 21, 2026 that may be closed by this pull request
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.

Subpath exports missing 'types' condition for moduleResolution: node

2 participants