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.

Backend API has valid response, but Detox is not getting the response (with Flipper installed)

See original GitHub issue

What happened?

I am running Detox on iOS, with backend (expressJS) running in localhost separately

I logged both the backend and frontend response body

When I run the detox test, the backend gave valid response body, but the frontend receives it undefined, even though the statusCode is 200

When i run without detox test, the network request is working fine.

I am not sure what am I missing to make the sure the network request body is not missing along the way…

What was the expected behaviour?

When backend API gave valid response, the frontend should receive the same response

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

Create a sample RN app, expressJS which returns some random response

Configure RN with detox and then have RN make network request to the expressJS app

Run the detox test

In what environment did this happen?

Detox version: 19.4.3 React Native version: 0.67 Node version: 16 Device model: iphone 12 iOS version: 15 macOS version: monterey Xcode version: 13.3.1 Test-runner (select one): jest-circus

Detox logs

Detox logs
paste logs here!

Device logs

no logs

More data, please!

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:25 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
asafkoremcommented, Jul 21, 2022

This PR resolves the issue: https://github.com/wix/Detox/pull/3499 I’ll release a patch version soon.

2reactions
DaAitchcommented, Jul 14, 2022

We have the same problem, that when detox starts the app on the simulator none of the HTTP responses have a body and JSON.parse('') fails, so it’s not even a network error.

When we write a detox test, that launches the app and wait a few seconds at first, we can manually close the app (really close by swiping away) and start the app again by clicking on it, everything starts to work and the test can run. This workaround is not possible with automatically terminate and relaunch the app. So this might be a hint, that the launchApp(..) makes the app start in a bad state with flipper, while starting the app by clicking on it not.

We currently fixed it by commenting out # use_flipper!(..), but we should better try the flipper downgrade.

If you need more information, please reach out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Followed Detox Mock Implementation but not working
I have tried to trigger the env variable through the metro and build command as well but with no luck. action/restaurants.js import Api...
Read more >
Dealing With Problems With Running Tests | Detox
This page is about issues related to executing your Detox tests, typically triggered when running detox test (and not detox build, for example)....
Read more >
Development Archives - Rule of Tech
Detox has good documentation to get you through the steps and has some troubleshooting tips you might come across especially with Android.
Read more >
react-native/CHANGELOG.md - UNPKG
This version of Android Gradle plugin enforces JDK 11 for Android builds. Do not upgrade to AGP 7.1 as it is not supported...
Read more >
@react-native-community/eslint-config | Yarn - Yarn
Installation. yarn add --dev eslint prettier @react-native-community/eslint-config. Note: We're using yarn to install deps. Feel free to change commands to ...
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