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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jonthysell opened this issue Apr 30, 2025 · 2 comments
Labels
bug Extensions Tracks issues against community modules and extensions External Issue tracked in this repo but change will need to happen in another repo help wanted New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric Workstream: Module Support Module developers have the requisite tooling and clear path for adding windows support to modules.
Milestone

Comments

@jonthysell
Copy link
Contributor

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

@jonthysell jonthysell added the bug label Apr 30, 2025
@jonthysell
Copy link
Contributor Author

This just started repro-ing in main today. I'm not 100% sure it's create-react-native-library's fault - CI ran fine in main today with create-react-native-library@0.49.8 and it worked fine. Now trying that version locally it fails.

Reverting all the way back to create-react-native-library@0.48.9 in PR #14631 worked to unblock us, but maybe because of some other updated dependency in the chain.

TLDR: 0.48.x works and 0.49.x doesn't, and the workaround may need to be applied to older stable branches to unblock them.

@jonthysell jonthysell added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label May 1, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Invalid Triage https://github.com/microsoft/react-native-windows/wiki/Triage-Process (label applied by bot) label May 1, 2025
@chrisglein chrisglein added help wanted Extensions Tracks issues against community modules and extensions External Issue tracked in this repo but change will need to happen in another repo New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric Workstream: Module Support Module developers have the requisite tooling and clear path for adding windows support to modules. labels May 1, 2025
@chrisglein
Copy link
Member

Recommend next step is to iterate on RNW's metro.config and overrides to see what's colliding here.

@chrisglein chrisglein added this to the Next milestone May 1, 2025
@chrisglein chrisglein removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) Invalid Triage https://github.com/microsoft/react-native-windows/wiki/Triage-Process (label applied by bot) labels May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Extensions Tracks issues against community modules and extensions External Issue tracked in this repo but change will need to happen in another repo help wanted New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric Workstream: Module Support Module developers have the requisite tooling and clear path for adding windows support to modules.
Projects
None yet
Development

No branches or pull requests

2 participants