React-native: Image crash

Created on 26 Oct 2016  Â·  49Comments  Â·  Source: facebook/react-native

Description

[error][tid:com.facebook.react.ImageLoaderURLRequestQueue][RCTNetworkTask.m:104] Missing request token for request: { URL: picture url }

The url of picture have been checked and is working fine.
Image

Reproduction

Put some Network Images on the Page and reloading the application, you will see this error. But about roughly 3% of the time when loading or reloading the application, we are getting a crash.

Additional Information

  • React Native version: 0.35
  • Platform: iOS
  • Operating System: MacOS
Stale

Most helpful comment

Started happening to me todays as soon as I started working on a component that has to fetch images dynamically (async). I had static images in my app before and I had never seen this error.

This is definitely coming from AJAX requests made by my app.

As other users have noted this is error is not happening all the time but is on and off... When I do a fresh reload of the app, everything works fine. However, it appears to me that as soon as a component that has fetched images via AJAX has dismounted, ALL images within the app have issues rendering, event static ones.

package.json:
"react": "16.0.0-alpha.12",
"react-native": "0.46.4",
Platform: iOS

EDIT: November 4th and still seeing this bug in development. Has anyone figured out if this bug also crashes the app within an actual iPhone? I was hoping for this to be a simulator-related bug.

All 49 comments

Hmm it seems like you have censored out a key part for reproducing this bug. Can you repro this using rnplay.org, and using an image that you feel okay sharing what it is?

I also experienced this bug when developing with RN (dev mode, simulator).
I'm not sure if it's somehow related to https://github.com/facebook/react-native/issues/10433

image

Same on my side. Resource exists if I check the path.
Happened on my side when I tried to use undefined variable.

import { take, put } from 'redux-saga/effects';
import { IMAGE } from '../actions/image';

function* watchImageFailure() {
  while (true) {
    const action = yield take(IMAGE.CREATE.FAILURE);
    Alert.alert('Error', 'Image wasn\'t uploaded');
  }
}

export default [
  watchImageFailure,
];

There was no Alert imported.

I'm experiencing pretty much the exact same thing today, intermittently.

Also getting this, and it's causing some images not to display. The images were working fine before and the paths have not changed.

I am also getting this error

For me, it happened when other remote image URLs on the same screen were
not responding. Once my image server was responding again, this exception
went away.

On 25 Mar 2017 00:42, "perrosnk" notifications@github.com wrote:

I am also getting this error

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native/issues/10553#issuecomment-289174595,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AASE-lns2vbKYE9YPTVdDDy5e_iUFORMks5rpGL2gaJpZM4Kg1G4
.

I just discovered that there was a similar issue with my server as well. Thank you @chrisharrison

I am experiencing this as well. Anyone aware of a fix or workaround for this issue?

Hello guys,

upping this issue as I see it also in my app with an asset picture. I'm using RN 0.39.
If anybody found a workaround it'd be great!
Thanks!

+1 for this issue happened after upgrading to RN 0.44

+1 Same issue happening here after RN 0.44. I'm using https://lorempixel.com images.

Same here. We updated some time ago to RN 0.41. But on Friday it worked, today on Monday we get this error all the time. What is this???

same on RN 0.43.4, random happen

same on RN 0.44, random happen

ping @ide @javache

Commenting +1 is not useful, those comments will be deleted.

Please provide a sample app that reproduces the issue.

same problem on RN0.38

same on RN 0.44, random happen

+1

A lot of people are +1'ing this issue but how many are coming back to say how they resolved it? As I said earlier, I do not believe this is an RN bug per se, but happens when your app is making errnoneous network requests or a server you are calling is not responding correctly.

hello... I am getting it today for our splash image that has otherwise worked 100%. I am trying to get our foregrounding - backgrounding ux to work well, and am seeing this now. This is a dev build hitting the local packager for a resource that would be baked-in in production. What is extra weird is that it first shows the splash page on resume (because that is baked into the xcode app maybe?) and then says the error about the splash screen. weird. The file really does exist, I can ls it ok. RN 0.45.1 on Mac OS 10.12.5 with node 6.11.1.

missingrequesttoken

nothting

random happen.reload again

Maybe you have to clear the cache, I was having the same issue.
Not sure if it is related to cache or AssyncStorage but i've reset both and the problem stoped.
Good Luck all

Same on RN 0.39.2, random happen when continues refresh.

This issue is occurring for me as well.
Happened after I did a build clean on iOS.

Started happening to me todays as soon as I started working on a component that has to fetch images dynamically (async). I had static images in my app before and I had never seen this error.

This is definitely coming from AJAX requests made by my app.

As other users have noted this is error is not happening all the time but is on and off... When I do a fresh reload of the app, everything works fine. However, it appears to me that as soon as a component that has fetched images via AJAX has dismounted, ALL images within the app have issues rendering, event static ones.

package.json:
"react": "16.0.0-alpha.12",
"react-native": "0.46.4",
Platform: iOS

EDIT: November 4th and still seeing this bug in development. Has anyone figured out if this bug also crashes the app within an actual iPhone? I was hoping for this to be a simulator-related bug.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

Crash into this with detox.

Also having this now.

Has anyone had any progress with this error? Would be awesome if anyone could give any other ideas why this might be happening. One of the ways I am making sure this does not happen is to gracefully handle Images 'unloading' / 'unmounting'. Make sure to have a Ternary operator that displays null if there is no source for the image. It does not matter if the image is not currently mounted!

Something like:

render()  {
    return (
        { this.props.source ? <Image source={{ uri: this.props.source }} /> : null }
    );
}

Maybe I have only been very lucky recently and I have not seen this problem again or this solution might actually do it. If it works for you too, then please let me know.

+1

+1

+100 to this!

I am seeing this error as well now, RN 0.50

Still happening here.

hi guys,

Is there anyone running into this one? This is really random. Sometimes it happens and fail the test. Sometimes it run normally. +9000

Seeing alot of this issue, RN 0.50

I ran into this one while using RN 0.52.

It seems to happen consistently if an Image component has flex: 1 set in its style.

I still get the same error on RN 0.53

Issue appeared for me after i updated from 0.51.0 to 0.53.3.

Getting the same error now on 0.52...

Wow, anyone fixed this?

Facing the same issue 😞

For me the issue only occurs when I rapidly refresh the simulator.
This is probably caused be the previous refresh not having a chance to complete the load, and then being aborted.
So it's not a biggy in my case

Facing the same issue when very slow internet
image

Same error here "react-native": "0.54.2"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anchetaWern picture anchetaWern  Â·  3Comments

axelg12 picture axelg12  Â·  3Comments

WG-Com picture WG-Com  Â·  3Comments

aniss picture aniss  Â·  3Comments

phongyewtong picture phongyewtong  Â·  3Comments