Skip to content

Cannot resolve tty with metro-config v0.77.2 #756

@Bill7zz

Description

@Bill7zz

Describe the bug
When using Storybook v9 with an Nx React Native project, the Metro bundler fails to resolve the tty module. This occurs during the initial bundling process when trying to run the React Native app with Storybook integration.

To Reproduce
I've created a reproduction repository at nx-monorepo

Steps to reproduce the behavior:

  1. Clone the reproduction repository
  2. Run npm install
  3. Run nx pod-install mobileApp to install iOS dependencies
  4. Run nx run-ios mobileApp
  5. The Metro bundler will fail with a Cannot resolve tty error

Expected behavior
The Metro bundler should successfully resolve all dependencies and start the React Native app with Storybook integration. The app should load and display the Storybook UI without any bundling errors.

Screenshots

Image

Code snippets
The error occurs during Metro bundling:

Welcome to Metro v0.81.5
Fast - Scalable - Integrated

ERROR  Error: Cannot resolve tty
    at .../nx-monorepo/node_modules/@nx/react-native/plugins/metro-resolver.js:31:15

System:

  • Node.js version: v22.15.1
  • Storybook version: 9.0.6
  • Nx version: 21.1.3
  • Metro config version: 0.77.2
  • Operating System: macOS (darwin 24.3.0)
  • Package Manager: npm

Additional context
Environment details:

  • Using an Nx monorepo setup with React Native
  • React Native app is configured as an Nx application

Repository structure:

  • Nx monorepo
  • React Native app located in apps/mobileApp
  • Using standard Nx React Native configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions