Microsoft/react-native-windows

New libs created with create-react-native-library > 0.48.9 have a new metro config that we don't support

Open

#14634 opened on Apr 30, 2025

View on GitHub
 (3 comments) (0 reactions) (0 assignees)C# (6,114 stars) (544 forks)batch import
ExtensionsExternalNew ArchitectureWorkstream: Module Supportbughelp wanted

Description

Problem Description

As part of our init-windows script, when applied to a library, we also add windows to any example app present. We mostly use what we're given, but we specifically override the given metro.config.js (as all RN apps, it doesn't work with windows out of the box).

Specifically for library example apps (which need to access the library) we incorporate the upstream changes present in create-react-native-library's metro config.

Starting with create-react-native-library@^0.49.0 however, they've completely refactored their metro config into some separate packages, and our version doesn't work anymore. Specicially, during bundling, you'll get an error that it can't find the library package anymore.

We'll need to figure out how to reconcile the differences.

Steps To Reproduce

  1. Create a new library with create-react-native-library@latest
  2. Add windows with init-windows
  3. Attempt to run the the example app with run-windows

Expected Results

The app runs

CLI version

15.0.0-alpha.2

Environment

info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.26100
  CPU: "(24) x64 AMD Ryzen Threadripper PRO 3945WX 12-Cores     "
  Memory: 38.60 GB / 63.86 GB
Binaries:
  Node:
    version: 18.18.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 3.6.1
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 9.8.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22621.0
      - 10.0.26100.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.14.35906.104 (Visual Studio Enterprise 2022)
    - 17.13.35931.197 (Visual Studio Enterprise 2022)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0-alpha.2
    wanted: 15.0.0-alpha.2
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.78.0-nightly-20250113-d4407d6f7
    wanted: 0.78.0-nightly-20250113-d4407d6f7
  react-native-windows:
    installed: 0.0.0-canary.949
    wanted: 0.0.0-canary.949
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Community Modules

No response

Target Platform Version

10.0.22621

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

ReleaseBundle

Snack, code example, screenshot, or link to a repository

No response

Contributor guide