Skip to content

fix: order "types" first in package.json exports - #330

Merged
oliverlaz merged 1 commit into
mainfrom
fix/exports-types-condition-order
Aug 18, 2026
Merged

fix: order "types" first in package.json exports#330
oliverlaz merged 1 commit into
mainfrom
fix/exports-types-condition-order

Conversation

@oliverlaz

Copy link
Copy Markdown
Member

Export conditions are matched top-to-bottom, first match wins. With "import" and "require" listed before "types", the types condition was unreachable — consumers resolving through "exports" (moduleResolution: node16 / bundler) never picked up the declarations, and esbuild warned on every vitest run:

▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]

Reordering "types" to the top fixes it. The top-level "types" field is kept as the fallback for legacy moduleResolution: node.

Verification

  • yarn vitest run no longer emits the warning (0 occurrences).
  • No behavior change to the emitted bundles — this only affects resolution order.

Export conditions are matched top-to-bottom, first match wins. With
"import" and "require" listed before "types", the types condition was
unreachable, so consumers resolving through "exports" (moduleResolution
node16/bundler) never picked up the declarations and esbuild warned about
it. The top-level "types" field is kept as the legacy fallback.
@oliverlaz
oliverlaz requested a review from szuperaz as a code owner August 17, 2026 08:12
@oliverlaz
oliverlaz merged commit 747e0c6 into main Aug 18, 2026
10 of 11 checks passed
@oliverlaz
oliverlaz deleted the fix/exports-types-condition-order branch August 18, 2026 07:36
oliverlaz pushed a commit that referenced this pull request Aug 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.7.64](v0.7.63...v0.7.64)
(2026-08-18)


### Features

* update to open api version 233.25.1
([#326](#326))
([618728a](618728a))
* update to open api version 235.16.3
([#328](#328))
([d4f0c22](d4f0c22))


### Bug Fixes

* correct query param serialization for arrays, dates and null
([#329](#329))
([7f228fc](7f228fc))
* order "types" first in package.json exports
([#330](#330))
([747e0c6](747e0c6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants