Skip to content

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

Open
@jonthysell

Description

@jonthysell

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExtensionsTracks issues against community modules and extensionsExternalIssue tracked in this repo but change will need to happen in another repoNew ArchitectureBroad category for issues that apply to the RN "new" architecture of Turbo Modules + FabricWorkstream: Module SupportModule developers have the requisite tooling and clear path for adding windows support to modules.bughelp wanted

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions