Skip to content

fix: resolve react types under bun's isolated linker#531

Merged
Luca Schneider (Mad-Kat) merged 7 commits into
mainfrom
fix/bun-type-issue
May 1, 2026
Merged

fix: resolve react types under bun's isolated linker#531
Luca Schneider (Mad-Kat) merged 7 commits into
mainfrom
fix/bun-type-issue

Conversation

@Mad-Kat

Copy link
Copy Markdown
Collaborator

Fixes #530.

Bun's isolated linker symlinks next-yak into ~/.bun/install/cache/links/. TypeScript follows the realpath, walks ancestors for react/@types/react, never reaches the project root, and types collapse to any — manifesting as TS2349 / TS2604 in consumer code.

Two changes:

  1. Declare react and @types/react as (optional) peer deps. Bun materializes peers next to the depending package, so the ancestor walk now finds them. Fixes the bug on today's Bun.
  2. Add types to every conditional exports entry (and flip dts: true for the three tsup entries that weren't emitting .d.ts). Forward-looking for oven-sh/bun#29728, which keys project-local materialization off the presence of types in exports.

@changeset-bot

changeset-bot Bot commented Apr 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 08db726

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
next-yak Patch
storybook-addon-yak Patch
next-yak-example Patch
@example/storybook Patch
vite-yak-example Patch
benchmarks Patch
docs Patch
yak-swc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Mad-Kat Luca Schneider (Mad-Kat) marked this pull request as ready for review April 28, 2026 06:13
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

🧪 Example preview: https://next-6pojegfne-jan-nicklas-projects.vercel.app
Built from 08db726

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

📚 Docs preview: https://next-yak-docs-4wcoysv7o-jan-nicklas-projects.vercel.app
Built from 08db726

@Mad-Kat Luca Schneider (Mad-Kat) merged commit 6582ebd into main May 1, 2026
7 checks passed
@Mad-Kat Luca Schneider (Mad-Kat) deleted the fix/bun-type-issue branch May 1, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript errors with Bun workspaces: TS2349 (noUncheckedIndexedAccess) + TS2786 (YakComponent not valid JSX)

2 participants