Tis is my first app in Expo (React Native) so I have no idea why this is happening. This is the output after "npx expo prebuild":
✔ Cleared android, ios code
✔ Created native projects | gitignore skipped
› Metro skipped: Project metro.config.js does not match prebuild template.
› Ensure the project uses @expo/metro-config.
Learn more
✔ Updated package.json and added index.js entry point for iOS and Android
› Installing using npm
» android: userInterfaceStyle: Install expo-system-ui in your project to enable this feature.
✔ Config synced
✔ Installed pods and initialized Xcode workspace.
this is my metro.config.file:
const { getDefaultConfig } = require("metro-config");
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts },
} = await getDefaultConfig();
return {
transformer: {
babelTransformerPath: require.resolve("react-native-svg-transformer"),
},
resolver: {
assetExts: assetExts.filter((ext) => ext !== "svg"),
sourceExts: [...sourceExts, "svg"],
},
};
})();
this is the metro config I always had during development so if you can point me in the right direction I would appreciate it.
3
Answers
Ok I solved it by adding:
Like this:
"Ensure the project uses @expo/metro-config."
So, replace
const { getDefaultConfig } = require("metro-config");
withconst { getDefaultConfig } = require('@expo/metro-config')
change
const { getDefaultConfig } = require("metro-config");
to
const { getDefaultConfig } = require('expo/metro-config');
From double to single quotes