React Native packager doesn't work

We use calabash for integration tests on a React Native project on iOS, and can’t use the packager. First even npm start wasn’t working so I thought it was a macOS Sierra issue with watchman (known issue) so I used El Capitan and this time npm start worked. After that, since it doesn’t continue the build and I changed that to nohop npm start > /dev/null &, but calabash still can neither start it’s own packager (fails with an error but continues running the tests) nor connect to the packager running(?) in the background.

Is there a way to make it work? Am I doing something wrong?

1 Like

Hey @farkob :wave:

Did you try to run it locally on your Mac? The same script I mean, or the build config with our CLI (https://www.bitrise.io/cli)?

I am trying to run it locally right now but I could not set the RSS private key and couldn’t figure out the correct inputs for git-clone step. Anyway so I used my local project folder and I removed everything up to xcode test and calabash steps and now calabash steps throws an error about a version conflict in cucumber which I couldn’t resolve after fiddling with my local versions. But on the Bitrise it runs the tests actually with failing them due to the reason I stated. Maybe I should try it running in a container, but I couldn’t figure out how to add the repo url and private key to the activate-ssh and git clone. Also, xcode-test also has a simulator step which can run packager correctly. So I believe if I resolve the version conflict issue the tests would run fine.

1 Like

For local debug did you follow this guide How to debug your build locally / "It works on my Mac/PC but not on bitrise.io" ?

It’s quite important to start with a clean git clone - most of these issues are not related to bitrise at all, instead related to something not under version control, or a dependency which’s version is not locked in your project and your local dependency version is not the same what bitrise.io gets when it runs the dependency manager (e.g. npm install / pod install / …) to get your project’s dependencies.

This guide might also help with a base config / layout:

Yeah we have a similar setup that works fine right now. But the problem is in calabash step

I should outline the actual process to give you a little more context.
React Native when run in debug mode, gets the package from a packager which runs as a separate process. It’s a regular http server which serves a javascript file for the app to consume and runs on port 8081.
If the app cannot connect to this packager, it shows a red error screen.
For the calabash tests to run this packager should run and be reached by the app.

Do you have any guesses why the packager is not reachable?

Not really. Maybe some kind of update? Eg in Calabash? Which works differently, but you might have a different version on your Mac

Are you sure that the server is running?