Closed jonthysell closed 1 year ago
This may be an upstream regression as within our repo bundling works fine, but even formerly passing PR builds now fail even without any dependency changes on our end.
Current suspect is the new version of Metro 0.76 which calls out breaking changes in asset resolution: https://github.com/facebook/metro/releases/tag/v0.76.0
It looks like this might be the upstream breaking change: https://github.com/react-native-community/cli/pull/1875
Hi @jonthysell! Yes this was caused by the above change, which comes in with @react-native-community/cli-plugin-metro@11.0.0
(and previous 11.x alphas when installed without a lockfile). Also broke the React Native RC branch (and main
) for a bit as we don't use a lockfile in our project template.
Some references in case they help you:
With the new CLI version included, the design is per https://github.com/facebook/react-native/pull/36502 — requires a complete metro.config.js
that extends @react-native/metro-config
to be read.
Please DM me on Twitter or RN Discord if I can help out.
Problem Description
When bundling a (release) bundle, the command fails with the following error:
This is reproable by either building the bundle manually with
react-native bundle
or by lettingreact-native run-windows --release
build the bundle.This is currently blocking all of our PRs from passing the checks where we create and test new CLI apps.
Steps To Reproduce
npx --yes react-native@0.0.0-20230308-2111-d41e95fb1 init testcli --template react-native@0.0.0-20230308-2111-d41e95fb1
npx --yes react-native-windows-init@latest --verbose --version 0.0.0-canary.634 --overwrite --language cpp --projectType app
yarn react-native bundle --platform windows --entry-file "index.js" --bundle-output "C:\code\testcli\windows\testcli\Bundle\index.windows.bundle" --assets-dest "C:\code\testcli\windows\testcli\Bundle" --dev false --reset-cache --sourcemap-output "C:\code\testcli\windows\x64\Release\testcli\sourcemaps\react\index.windows.bundle.map"
Expected Results
Bundle building succeeds
CLI version
11.0.0-alpha.2
Environment
Target Platform Version
10.0.19041
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2022
Build Configuration
ReleaseBundle
Snack, code example, screenshot, or link to a repository
No response