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.

Undefined only on android

See original GitHub issue

When i try to fetch anything from my api i get the following error in pidcat: [TypeError: undefined is not an object (evaluating 'error.response.status')]. In your source is only one place with error.response.status

var getProblemFromError = function getProblemFromError(error) {
    // first check if the error message is Network Error (set by axios at 0.12) on platforms other than NodeJS.
    if (error.message === 'Network Error') return NETWORK_ERROR;
    // then check the specific error code
    return R.cond([
    // if we don't have an error code, we have a response status
    [R.isNil, function () {
      return getProblemFromStatus(error.response.status);
    }], [R.contains(R.__, TIMEOUT_ERROR_CODES), R.always(TIMEOUT_ERROR)], [R.contains(R.__, NODEJS_CONNECTION_ERROR_CODES), R.always(CONNECTION_ERROR)], [R.T, R.always(UNKNOWN_ERROR)]])(error.code);
  };

Do you know what my problem is and what i’am doing wrong?

I use this commit https://github.com/skellock/apisauce/commit/7aa56ac3520e19a8327d8038af8ec8fb0079ffb5 and rn 0.32.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
skellockcommented, Sep 27, 2016

I bet https://github.com/skellock/apisauce/blob/master/lib/apisauce.js#L173 is the problem. We’re looking for an english match.

I did it like this because at the time, React Native wasn’t bubbling up the right platform networking error. There have been several changes since then, so I’ll have to go back and revisit that error message.

1reaction
maluramichaelcommented, Sep 27, 2016

When i type the following in my terminal adb shell input keyevent 82 the debug menu on my device opens and i press Debug JS Remotely everything works fine. When i disable the remote debugger every call throws the Network error.

And i changed the device language to english and the status is still undefined.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Share.open return message as undefined on android ...
Share.open return message as undefined on android device always once user share any content on other apps and return on actual app.
Read more >
cannot read property 'direction' of undefined - Android Only
Hi I am using react-native-navigation and "react-native-gesture-handler": "^1.5.2" It works fine on ios but I get cannot read property ...
Read more >
undefined - JavaScript - MDN Web Docs - Mozilla
The global undefined property represents the primitive value undefined. It is one of JavaScript's primitive types.
Read more >
Preview Error: Cannot read property 'params' of undefined
Does anyone know how to fix it? I haven't set up any complex features, logic, or authentication. I am only building pages.
Read more >
[SSL Pinning Plugin] Error - Cannot read property 'apply' ...
I have just tested the app on new android device. With Cloned Multilingual. The app is crashing and in error logs its showing...
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