I am using monorepo(NX). nx automatically update the metro packages which are inside node_module/@nx/react-native.
my react native package is 0.71.8 and my metro.config.js file is
`const { withNxMetro } = require('@nx/react-native');
const { getDefaultConfig } = require('metro-config');
const exclusionList = require('metro-config/src/defaults/exclusionList');
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts },
} = await getDefaultConfig();
return withNxMetro(
{
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
resolver: {
assetExts: assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
},
},
{
// Change this to true to see debugging info.
// Useful if you have issues resolving modules
debug: false,
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx', 'json'
extensions: [],
// the project root to start the metro server
projectRoot: __dirname,
// Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
watchFolders: [],
}
);
})();
now the error is in isAssetFile.js which are in node_modules/@nx/react-native/node_modules/metro-resolver/src/utils/isAssetFile.js
I am using monorepo(NX). nx automatically update the metro packages which are inside node_module/@nx/react-native. my react native package is 0.71.8 and my metro.config.js file is `const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); const exclusionList = require('metro-config/src/defaults/exclusionList');
now the error is in isAssetFile.js which are in node_modules/@nx/react-native/node_modules/metro-resolver/src/utils/isAssetFile.js