Skip to content

[Bug]: Storybook React Native Web - Issue with Testing addons installation #33844

@jonniebigodes

Description

@jonniebigodes

Describe the bug

When a user attempts to install Storybook and selects the React Native Web framework, the installation process offers the option to choose either the minimal development option or the recommended option that includes testing tools (e.g., Vitest addon, A11y, etc.).
However, when the user selects the recommended option, the installation process fails to complete successfully in adding the necessary dependencies for the testing option, leaving the user with a broken Storybook installation with references to the testing addons that were not properly installed.

Reproduction link

N/A

Reproduction steps

  1. Create a new Expo project with npx create-expo-app@latest
  2. Run npx storybook@latest init and select the React Native Web option
  3. Select the recommended option for development, docs, and testing features
  4. Observe that the installation process fails to complete successfully with errors related to the testing addons
npx storybook@latest init

T  Initializing Storybook
|
•  Adding Storybook version 10.2.7 to your project
|
o  We've detected a React Native project. Install:
|  React Native Web: Storybook on web for docs, test, and sharing
|
o  Framework detected: react-native-web-vite
|
o  What configuration should we install?
|  Recommended: Component development, docs, and testing features.
|
•  Storybook collects completely anonymous usage telemetry. We use it to shape
|  Storybook's roadmap and prioritize features. You can learn more, including how
|  to opt out, at https://storybook.js.org/telemetry
|
*  Storybook configuration generated
|
|  - Configuring ESLint plugin
|  - Configuring main.ts
|  - Configuring preview.ts
|  - Adding Storybook command to package.json
|  - Copying framework templates
|
*  Dependencies added to package.json
|
|  Adding devDependencies:
|  - storybook@^10.2.7
|  - @storybook/react-native-web-vite@^10.2.7
|  - @chromatic-com/storybook@^5.0.1
|  - @storybook/addon-vitest@^10.2.7
|  - @storybook/addon-a11y@^10.2.7
|  - @storybook/addon-docs@^10.2.7
|  - vite@^7.3.1
|  - eslint-plugin-storybook@^10.2.7
|  - vitest
|  - playwright
|  - @vitest/browser-playwright
|  - @vitest/coverage-v8
|
o  Dependencies installed
|
x  Failed to configure addons
|
|  Configuring @chromatic-com/storybook...
|  @chromatic-com/storybook configured
|
|  Configuring @storybook/addon-vitest...
|  Creating a Vitest setup file for Storybook:
|  C:/Users/my-user/projects/testing-storybook-rn/.storybook/vitest.setup.ts
|
|  Creating a Vitest config file:
|  C:/Users/my-user/projects/testing-storybook-rn/vitest.config.ts
|  Setting up a11y addon for @storybook/addon-vitest
|  Command failed with exit code 127: yarn.cmd exec "storybook@10.2.7" automigrate addon-a11y-addon-test --loglevel silent --yes --skip-doctor --package-manager yarn2 --skip-install
|  Could not automatically set up @storybook/addon-a11y for @storybook/addon-vitest.
|  Please refer to the documentation to complete the setup manually:
|  https://storybook.js.org/docs/writing-tests/accessibility-testing#integration-with-vitest-addon
|  Done, but with errors!
|  @storybook/addon-vitest was installed successfully, but there were some errors during the setup process. Please refer to the documentation to complete the setup manually and check the errors above:
|  https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#manual-setup-advanced
|  Configuring @storybook/addon-a11y...
|  Configuring @storybook/addon-docs...
|  @storybook/addon-docs configured
|
|
|  ✅ @chromatic-com/storybook
|  ❌ @storybook/addon-vitest
|  ❌ @storybook/addon-a11y
|  ✅ @storybook/addon-docs
|
|  Playwright browser binaries are necessary for @storybook/addon-vitest. The
|  download can take some time. If you don't want to wait, you can skip the
|  installation and run the following command manually later:
|  yarn exec playwright install chromium --with-deps
|
*  Do you want to install Playwright with Chromium now?
|  > Yes /   No
  1. Start Storybook and notice that the A11y addon shows as failed to be configured/installed. However, it's present and functioning.

System

|
|
|  Storybook Environment Info:
|

|  System:
|  OS: Windows 11 10.0.26200
|  CPU: (16) x64 AMD Ryzen 7 7435HS
|  Binaries:
|  Node: 24.10.0 - C:\nvm4w\nodejs\node.EXE
|  Yarn: 4.12.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD <----- active
|  npm: 11.6.1 - C:\nvm4w\nodejs\npm.CMD
|  pnpm: 7.13.6 - C:\nvm4w\nodejs\pnpm.CMD
|  Browsers:
|  Chrome: 144.0.7559.133
|  Edge: Chromium (140.0.3485.54)
|  npmPackages:
|  @storybook/addon-a11y: ^10.2.7 => 10.2.7
|  @storybook/addon-docs: ^10.2.7 => 10.2.7
|  @storybook/addon-vitest: ^10.2.7 => 10.2.7
|  @storybook/react-native-web-vite: ^10.2.7 => 10.2.7
|  eslint-plugin-storybook: ^10.2.7 => 10.2.7
|  storybook: ^10.2.7 => 10.2.7

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions