Skip to content

Autostart metro server in Xcode with monorepo #2064

@exzos28

Description

@exzos28

Environment

"react-native": "0.72.3"
"@react-native-community/cli" "11.3.5"

Description

Hi, I have this problem that the server autostart is not working.

I have a monorep:

  • packages
    -- mobile
    -- shared

All modules are stored in the root.

The error occurs when running packages/mobile/ios in Xcode (without running metro server):

Node found at: /Users/user/.nvm/versions/node/v16.20.0/bin/node
error No metro config found in /Users/user/Documents/dev/monorepo.
Process terminated. Press <enter> to close the window

This is because launchPackager.command is trying to find metro.config.js relative to where it is located (in the root node_modules).

image

Demo

You need to open packages/mobile/ios in XCode and just run it.
https://github.com/exzos28/mono-repo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions