Skip to content

React Native Web: Fix TypeScript 6 peer conflict - #36445

Merged
valentinpalkovic merged 6 commits into
storybookjs:nextfrom
valentinpalkovic:agent/sto-717-rnw-ts6
Oct 9, 2026
Merged

valentinpalkovic merged 6 commits into
storybookjs:nextfrom
valentinpalkovic:agent/sto-717-rnw-ts6

Conversation

@valentinpalkovic

@valentinpalkovic valentinpalkovic commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #36305

Problem

@storybook/react-native-web-vite installed vite-tsconfig-paths in consumer projects. That package installs deprecated tsconfck@3.1.6, whose optional peer accepts only TypeScript 5. A React Native Web project using TypeScript 6 with strict pnpm peer checks therefore could not install Storybook, even though Storybook itself supports TypeScript 6:

[ERR_PNPM_PEER_DEP_ISSUES] Unmet peer dependencies

✕ unmet peer typescript
  Installed: 6.0.3
  Wanted:
    ^5.0.0:
      tsconfck@3.1.6

Reproduce before this fix

The public reproduction is https://github.com/NiGhTTraX/sb-rnw-ts-peer-dep.

git clone https://github.com/NiGhTTraX/sb-rnw-ts-peer-dep
cd sb-rnw-ts-peer-dep
pnpm install
pnpm peers check

With the affected package, pnpm peers check reports the tsconfck@3.1.6 / TypeScript 6 conflict shown above.

This PR keeps vite-tsconfig-paths inside the Storybook bundle instead of installing it into the consumer dependency graph. TypeScript remains external as an optional >=5.9 peer, so strict installs accept both TypeScript 5.9 and 6 while the existing Vite 6/7/8 path-resolution behavior is preserved.

What I did

  • Bundled the existing vite-tsconfig-paths implementation into @storybook/react-native-web-vite instead of installing it in consumer projects.
  • Declared TypeScript >=5.9 as an optional peer so the build keeps TypeScript external while accepting both TypeScript 5.9 and 6.
  • Preserved the stable resolver's delegation to Vite, including React Native Web's .web.* extension precedence across Vite 6, 7, and 8.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Caution

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

  1. Run yarn nx compile react-native-web-vite --skip-nx-cache.
  2. Pack the framework with yarn workspace @storybook/react-native-web-vite pack -o "$PWD/react-native-web-vite.tgz".
  3. In a pnpm fixture that uses TypeScript 6 and Vite 6, 7, or 8, install the tarball with strict peer checks: pnpm add --save-exact /absolute/path/to/react-native-web-vite.tgz --strict-peer-dependencies.
  4. Confirm installation succeeds without a tsconfck/TypeScript peer error. Repeat with TypeScript 5.9 if desired.
  5. For path-resolution regression coverage, configure a tsconfig alias whose only target is a .web.ts or .web.tsx file and confirm a Vite build resolves an extensionless aliased import.

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Declare whether manual QA will be needed for this PR during the next release, through qa:needed or qa:skip

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary Release - 🚫 Not run

This PR does not have a canary release associated.

In-repo PRs: add the ci:canary label. Later pushes republish while the label remains.

Fork PRs: the label does nothing (a later push must not auto-publish). A maintainer publishes from this repository with Run workflow and the pr input. branch and sha are optional; if more than one is set, they must be the same commit. The fork author does not need to do anything.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@valentinpalkovic valentinpalkovic added bug ci:daily Run the CI jobs that normally run in the daily job. qa:skip Pull Requests that do not need any QA. (e.g. documentation) labels Sep 25, 2026
@storybook-app-bot

storybook-app-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Package Benchmarks

Commit: 526604a, ran on 9 October 2026 at 08:15:40 UTC

The following packages have significant changes to their size or dependencies:

@storybook/react-native-web-vite

Before After Difference
Dependency count 120 117 🎉 -3 🎉
Self size 29 KB 104 KB 🚨 +75 KB 🚨
Dependency size 26.29 MB 26.10 MB 🎉 -198 KB 🎉
Bundle Size Analyzer Link Link

@storybook/vue3-vite

Before After Difference
Dependency count 95 95 0
Self size 32 KB 32 KB 🎉 -24 B 🎉
Dependency size 18.77 MB 18.75 MB 🎉 -20 KB 🎉
Bundle Size Analyzer Link Link

@storybook/web-components-vite

Before After Difference
Dependency count 6 6 0
Self size 19 KB 19 KB 🎉 -12 B 🎉
Dependency size 515 KB 454 KB 🎉 -62 KB 🎉
Bundle Size Analyzer Link Link

@storybook/vue3

Before After Difference
Dependency count 91 91 0
Self size 229 KB 209 KB 🎉 -20 KB 🎉
Dependency size 18.21 MB 18.21 MB 0 B
Bundle Size Analyzer Link Link

@storybook/web-components

Before After Difference
Dependency count 4 4 0
Self size 182 KB 121 KB 🎉 -62 KB 🎉
Dependency size 126 KB 126 KB 0 B
Bundle Size Analyzer Link Link

@valentinpalkovic
valentinpalkovic marked this pull request as ready for review September 25, 2026 09:33
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d028726f-0b1e-4e67-81eb-6423abce675e

📥 Commits

Reviewing files that changed from the base of the PR and between 191526d and 526604a.


⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: c911ca8c-3ff6-4afd-8209-8028b08656f6


📥 Commits

Reviewing files that changed from the base of the PR and between c59a545 and b19ff79.


⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

📒 Files selected for processing (1)
  • code/frameworks/react-native-web-vite/package.json

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.



Walkthrough

The package moves vite-tsconfig-paths from runtime dependencies to development dependencies. It retains TypeScript as a development dependency and adds it as an optional peer dependency with a minimum version of 5.9.x.

Changes

Package dependencies

Layer / File(s) Summary
Package dependency declarations
code/frameworks/react-native-web-vite/package.json
vite-tsconfig-paths moves to development dependencies. TypeScript remains a development dependency and is added as an optional peer dependency with the range >= 5.9.x.

Priority: ⬇️ Low

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to b19ff

The TypeScript 6 peer conflict appears resolved, with no identified issue requiring a change before merge.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@valentinpalkovic valentinpalkovic removed the ci:daily Run the CI jobs that normally run in the daily job. label Sep 25, 2026
@valentinpalkovic valentinpalkovic added the ci:daily Run the CI jobs that normally run in the daily job. label Sep 25, 2026 — with Paperclip for GitHub
@ndelangen
ndelangen requested a review from dannyhw October 2, 2026 09:14
@valentinpalkovic
valentinpalkovic merged commit 6c86450 into storybookjs:next Oct 9, 2026
254 of 261 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 9, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-scan:human bug ci:daily Run the CI jobs that normally run in the daily job. qa:skip Pull Requests that do not need any QA. (e.g. documentation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: React Native Web has peer dependency errors with typescript 6+

2 participants