question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fix packager start for XCode

See original GitHub issue

Running App from XCode didn’t work anymore. All paths which bable resolver plugin use are broken. Running App from CLI with react-native start ios --reset-cache works.

Reason: packager.js will be started from wrong path. Detail-Description & Solution

Environment

React Native Environment Info: System: OS: macOS 10.14.2 CPU: (4) x64 Intel® Core™ i5-2400 CPU @ 3.10GHz Memory: 62.86 MB / 6.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 11.6.0 - /usr/local/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 6.5.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 IDEs: Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.6.3 => 16.6.3 react-native: ^0.58.4 => 0.58.4 npmGlobalPackages: react-native-cli: 2.0.1

Thanks to @emusgrave for figuring this out.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
MatthieuLemoinecommented, Feb 8, 2019

This issue occurs since Metro v0.47.

It happens when the the start command of the local-cli is not executed in the projectRoot directory e.g when you let Xcode start the packager for you. In this case, the cwd will be ${projectRoot}/node_modules/react-native.

Some babel plugins such as babel-plugin-module-resolver or babel-plugin-import-graphql fail to resolve files because of it. They receive wrong filenames from Babel such as ${projectRoot}/node_modules/react-native/src/index.js instead of ${projectRoot}/src/index.js.

This issue doesn’t occur if you start the packager yourself using node node_modules/react-native/local-cli/cli.js start from your projectRoot.

It comes from this line. This script change the working directory to ${projectRoot}/node_modules/react-native and start Metro from there. I think that it should cd into the projectRoot instead.

4reactions
xstablecommented, Mar 6, 2019

Will this be fixed in 0.59.0 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode 12.5 stays in a loop "Resolv… | Apple Developer Forums
Try opening Xcode 12.5 preferences go to Locations and set DerivedData to default location. Problem went away for me. This is a less...
Read more >
Xcode 13.2.1 unable to resolve Swift Package Manager
use Xcode "File" -> "Packages" -> "Resolve Packages"; alternately, close the project, then reopen it. You will probably get some warnings when ...
Read more >
Oh dear! Build errors? - LoopDocs - GitHub Pages
Fix 95% of errors¶ · Open your project in Xcode as normal. · On the far right, next to the name Full Path...
Read more >
Code signing issues in Xcode 14 and how to fix them
The first dependency manager in which this code signing problem occurs is the Swift Package Manager. It works fine for Xcode 13 if...
Read more >
How to Make a Swift Package! (Xcode) - YouTube
Today we set up our first Swift Package and upload it to GitHub and use it in an example project! Enjoy!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found