Skip to content

[Bug] npx gluestack-ui init breaks babel.config.js on React Native 0.86+ #3421

Description

@spyingcoder

Environment

  • React Native: 0.86.0
  • Gluestack UI CLI: latest
  • NativeWind: 4.1.23
  • Node: 24.x
  • Platform: macOS (Apple Silicon)

Problem

Running npx gluestack-ui init on a fresh RN 0.86 project
overwrites babel.config.js and replaces the correct preset:

// Correct (RN 0.72+)
presets: ['@react-native/babel-preset']

with the deprecated one:

// Wrong — package removed in RN 0.72
presets: ['module:metro-react-native-babel-preset']

This causes Metro to throw:

Cannot find module 'metro-react-native-babel-preset'

Additional Issues

  1. CLI installs react-native-reanimated@~4.1.0 which is
    incompatible with RN 0.86. Requires manual upgrade to 4.4.1.

  2. react-aria dependency pulls in react-dom which doesn't
    exist in RN. Requires metro.config.js resolver fix:

   extraNodeModules: { 'react-dom': require.resolve('react-native') }
  1. CLI copies docs/, examples/, .handlebars files into project
    alongside component files. Only index.tsx files should be copied.

Fix

  1. Update CLI template to use @react-native/babel-preset
  2. Update reanimated peer dependency to support RN 0.84+
  3. Exclude docs/examples from component copy operation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions