-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Bundling fails for new apps built against main with missing-asset-registry-path error #11437
Comments
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 |
New app projects built against main are unable to create their bundle (see microsoft#11437). As such, all PRs are blocked as the New CLI app checks all fail. The problem is that the metro config needs `transformer.assetRegistryPath` to be set to the location of `./Libraries/Image/AssetRegistry`, which for our purposes is the copy located in the RNW folder. For some reason this isn't set anymore. This PR adds a workaround of specifying that path in our app template's metro.config.js file. This unblocks our PRs but we should probably find a better place than in an app template file. Resolves microsoft#11437
It looks like this might be the upstream breaking change: react-native-community/cli#1875 |
…#11438) ## Description New app projects built against main are unable to create their bundle (see #11437). As such, all PRs are blocked as the New CLI app checks all fail. The problem is that the metro config needs `transformer.assetRegistryPath` to be set to the location of `'react-native/Libraries/Image/AssetRegistry'`, as for some reason this isn't set anymore upstream. This PR adds a workaround of specifying that path in our app template's metro.config.js file. This unblocks our PRs but we should probably find a better place than in an app template file. ### Type of Change - Bug fix (non-breaking change which fixes an issue) - Breaking change (fix or feature that would cause existing functionality to not work as expected) ### Why Unblock our PRs. Resolves #11437 ### What Updates the new app template's metro.config.js file with the correct path which is no longer getting set for us. ## Screenshots N/A ## Testing Tested with a new CLI app. ###### Microsoft Reviewers: [Open in CodeFlow](https://portal.fabricbot.ms/api/codeflow?pullrequest=https://github.com/microsoft/react-native-windows/pull/11438) ###### Microsoft Reviewers: [Open in CodeFlow](https://portal.fabricbot.ms/api/codeflow?pullrequest=https://github.com/microsoft/react-native-windows/pull/11438)
Hi @jonthysell! Yes this was caused by the above change, which comes in with Some references in case they help you:
With the new CLI version included, the design is per facebook/react-native#36502 — requires a complete
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
The text was updated successfully, but these errors were encountered: