-
Notifications
You must be signed in to change notification settings - Fork 638
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
Couldn't connect Metro with iOS or Android emulator after upgrading to 0.72.1 #1028
Comments
Hi @molchanovskiy! I'm not sure that we support receiving config as a promise. Please note also that:
Please can you try simplifying your config file to: const path = require("path");
const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
const defaultConfig = getDefaultConfig(__dirname);
const { resolver: { sourceExts, assetExts } } = defaultConfig;
/**
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
*
* @type {import('metro-config').MetroConfig}
*/
const config = {
transformer: {
babelTransformerPath: require.resolve("react-native-svg-transformer"),
},
resolver: {
assetExts: assetExts.filter((ext) => ext !== "svg"),
sourceExts: [...sourceExts, "svg"],
resolverMainFields: ["sbmodern", "react-native", "browser", "main"],
},
watchFolders: [path.resolve(__dirname, "../")],
};
module.exports = mergeConfig(defaultConfig, config); |
Hello @huntie Do you know what is causing this error below? It is working and Metro connected with app and displaying everything, but I see this Error when Metro started.
|
Actually it was fixed by deleting node_modules and installing clear ones. |
@huntie thanks you |
@huntie worked. Thx |
Description
We are using this project structure
App is running success even with error when Metro starting automatically xcode script "error No metro config found in"
When I run metro manually from app folder it works fine but not connected to app, app is working but no logs are shown in Metro, app is not reloading by pressing R, so it is not connected with app and seems like Metro is running somewhere is background or something, I can't find what is causing it.
Metro config:
What can be wrong? Should I pass a custom metro config path somehow or something?
React Native Version
0.72.1
Output of
npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 13.4
CPU: (10) arm64 Apple M1 Max
Memory: 91.36 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 16.13.0
path: ~/.nvm/versions/node/v16.13.0/bin/node
Yarn:
version: 3.3.1
path: ~/.yarn/bin/yarn
npm:
version: 9.4.2
path: ~/.nvm/versions/node/v16.13.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.12.1
path: /Users/a.mochanovskiy/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.4
- iOS 16.4
- macOS 13.3
- tvOS 16.4
- watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9514443
Xcode:
version: 14.3.1/14E300c
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.17
path: /Users/a.mochanovskiy/.jenv/shims/javac
Ruby:
version: 2.7.6
path: /Users/a.mochanovskiy/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.1
wanted: ^0.72.1
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: true
newArchEnabled: false
Steps to reproduce
Run app with xcode or by terminal command
"ios": "concurrently \"yarn start\" \"yarn setup:au-dev && cd ios && pod install && cd .. && react-native run-ios --simulator='iPhone 14' --scheme=DEV_AU_DEBUG --configuration=DEV_AU_DEBUG\""
Snack, code example, screenshot, or link to a repository
`Node found at: /Users/a.mochanovskiy/.nvm/versions/node/v16.13.0/bin/node
error No metro config found in /Users/a.mochanovskiy/Projects/fe-app.
Process terminated. Press to close the window`
The text was updated successfully, but these errors were encountered: