You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From then on, I'm getting "Cannot read property 'default' of undefined". (see screenshot)
I wonder if I'm using config options which conflict with each other? I had to enable above because I'm creating a package that uses the package exports property. This local package is symlinked to our main project in a monorepo structure.
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.
What is the expected behavior?
Before I enabled above options, everything was just resolving fine.
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
const{ getDefaultConfig, mergeConfig }=require('@react-native/metro-config');constdefaultSourceExts=require('metro-config/src/defaults/defaults').sourceExts;constexclusionList=require('metro-config/src/defaults/exclusionList');const{ getMetroTools }=require('react-native-monorepo-tools');constmonorepoMetroTools=getMetroTools();/** * Metro configuration for React Native * https://github.com/facebook/react-native * * @format */constgetSourceExts=()=>{constexts=process.env.RN_SRC_EXT
? process.env.RN_SRC_EXT.split(',').concat(defaultSourceExts)
: defaultSourceExts;returnexts;};constconfig={transformer: {getTransformOptions: async()=>({transform: {inlineRequires: true,},}),},watchFolders: monorepoMetroTools.watchFolders,resolver: {unstable_enableSymlinks: true,unstable_enablePackageExports: true,unstable_conditionNames: ['react-native','require','import'],sourceExts: getSourceExts(),// Ensure we resolve nohoist libraries from this directory.blockList: exclusionList(monorepoMetroTools.blockList),extraNodeModules: {
...monorepoMetroTools.extraNodeModules,stream: require.resolve('readable-stream'),},},};module.exports=mergeConfig(getDefaultConfig(__dirname),config);
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
I enabled these three resolver options:
From then on, I'm getting "Cannot read property 'default' of undefined". (see screenshot)
I wonder if I'm using config options which conflict with each other? I had to enable above because I'm creating a package that uses the package exports property. This local package is symlinked to our main project in a monorepo structure.
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.What is the expected behavior?
Before I enabled above options, everything was just resolving fine.
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
yarn version: v1.22.19
node version: v18.18.0
react-native info output
The text was updated successfully, but these errors were encountered: