Skip to content

Commit 19c140b

Browse files
authored
Workaround fix for "missing-asset-registry-path" error to unblock PRs (#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)
1 parent 8b1aaf9 commit 19c140b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Workaround fix for \"missing-asset-registry-path\" error to unblock PRs",
4+
"packageName": "react-native-windows",
5+
"email": "jthysell@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

vnext/template/metro.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ module.exports = {
3232
inlineRequires: true,
3333
},
3434
}),
35+
// This fixes the 'missing-asset-registry-path` error (see https://github.com/microsoft/react-native-windows/issues/11437)
36+
assetRegistryPath: 'react-native/Libraries/Image/AssetRegistry',
3537
},
3638
};

0 commit comments

Comments
 (0)