-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
images not always rendering after code-push update #699
Comments
react-native-code-push version: v1.17.0-beta There is my build bundle command:
release new version to code push command:
There is webview load from local html and got error.
If I use
all thing will be ok! |
@Micjoyce, I could see that your bundle command does not contain
You probably need to use smth like this:
Could you please try to use commands I've listed above and let me know if any changes? |
@ivpusic, We've probable have not faced with this random issue before, so could you please provide me with the way you are loading images (i.e. the require(./foo.png) syntax or smth else) and releasing CodePush updates (vanilla |
@sergey-akhalkov sorry for delay. // example 1:
<Image style={[style, {width: dimension, height: dimension, borderRadius: dimension / 2}]} source={{uri: 'https://...'}} />
// example 2:
<Image style={{width: smallDimensions, height: smallDimensions}} source={require('myapp/assets/...')} /> release commands code-push release-react -m myapp-ios ios
code-push promote -m myapp-ios Staging Production I can confirm that the same is happening also for RN 0.42-RC3 + RNCP v1.17.0-beta |
@ivpusic, sorry for slow responce.
Do I get it right that all images will show up in case you manually triggering component rerenderer by calling |
@sergey-akhalkov sorry for a delay...so all images are showing up correctly in 90% percent of the cases. When 10% happen, then if I have 20 images on the screen, maybe 15 of them won't show...it is really random. How I "fix" this, is just to navigate to another tab in the application, go back, and then they will show up. As I said before....this happens only after I push some fix via code-push. If the application did not download code-push update, then this never happens. |
Are you using React Native Navigation Module: https://github.com/wix/react-native-navigation? The root cause of the issue could probably be here, but we need to check it, so could you please verify if the issue reproduces in case you are not using Navigation Module? I also can see that your second example contains absolute path: // example 2:
<Image style={{width: smallDimensions, height: smallDimensions}} source={require('myapp/assets/...')} /> Please note, that absolute path maps to the old (binary) version of the image, you should use relative paths instead if you want to update assets (images) via CodePush. |
I am using https://github.com/react-community/react-navigation for navigation. Tnx for tip regarding loading images. Will do it that way in the future. However this issue happens also for images which are loaded over network (https) |
@ivpusic, could also please confirm if you've CodePush-ified your app's root component? |
yes |
Hi @ivpusic, I've tried to reproduce the issue but with no luck again, so I'm closing this for now. |
I also have the exact same issue issue described by ivpusic: after a code-push update of the app, the application is missing quite a few images using a source using require('path'). Once we navigate away from those broken screens and come back, the images appear again. This makes it quite impossible to use code-push at this stage then. |
Hello @pcarion, thank you for reaching us. Could you please answer several questions:
I'll try to reproduce the issue again using example apps from |
react-native-code-push version: v2.0.1-beta I am having similar issues and thought I would toss in a few thoughts to possibly help get to the heart of the issue. One thing I would suggest is tossing in what items you are using for codePush.sync. I am running the following in componentDidMount on my entry component.
When you hard close the app and re-open is when you see the issue happen. If you resume the app theres no issue since the component didnt mount again it doesnt run sync. If you remove sync altogether is also starts to work as expected. My theory is that calling sync is blocking while it either checks for an update or syncs the assets. Not really sure how to go about debugging that (iOS noob). I looked at the sample app and the reason it may be hard to duplicate is those syncs are being called when the action happens rather than every time the component is mounted. Thats an assumption on my part not knowing if you did it on componentDidMount or not but feel free to correct if you did @sergey-akhalkov I will try and see if I can get some free time in the next day or two and post up a version of the example app similar to how I am using it. |
Hey guys, I've reproduced the issue but for Android only, so I've created new issue in React Native repo due to it reproduces even if CodePush module not integrated into the project. |
Ive tested that project on iOS and it works perfect. All images load as expected relatively fast. I took that project and changed it to the following to add CodePush. react-native: 0.43.3
Two things changed.
The issue I noticed was after I pushed an update to CodePush but its interesting to note that once I added CodePush to the componentDidMount it changed the way the initial load happens. In the base example it loads the screen and you see each image load individually. However once CodePush was introduced it showed a white screen for a few seconds before displaying the green background and all of the images already loaded. The next step is pushing changes to the app. I added 100 new images and changed the background color back to #F5FCFF. I then ran the following 2 commands. (I know I know I could just deploy to Staging) After doing that the first load it did the white screen again. Then it showed the green background with the 100 images. Then it refreshed and changed the background with updated images and no stutter. I then hard closed the app and and opened it. Everything worked as expected. There was no white screen, no stutter in loading, nothing...I am a little stumped. I am going to try and do 2 new things later today.
I have no idea if those will impact anything but we will see. |
Hi @cmoody, got it, please let me know if any changes. |
Hello @cmoody, do you have any updates? |
Hey @sergey-akhalkov, I tested out using external images to see if the network requests caused some impact. It didnt seem to impact the load time really at all. In my application (non test one) I have removed CodePush which has slightly increased load time but it looks like there is another issue going on. I think I need to look at some network request clean up and when components are loading to see if thats messing things up. So for me I think this issue isnt a CodePush issue. Thanks for the help. |
@cmoody, thanks for the response, so I'm closing this for now again, we'll reopen it when more info or stable repro will be available. |
Im having same issue. Without code push i get no white flashes. Soon as i enable it i get white flashes after the splash screen and when i navigate to a new screen. |
I was also facing this issue, When I did second time push the code then images are not visible. So i found solution for it. |
Processing phase is a bit cumbersome. But maybe you found the cause, thanks for saving me 😂😂 thank you so much |
@sergey-akhalkov the answer from @rakeshkumar217 seems working and it means their is sth wrong with asset control when deploying via codepush. I don't think taking extra time for bundling assets is a good approach. I think it should all be done just by typing Any updates on this issue? are you still following? |
Anything update this issue? |
@HikoVinhHo would #1350 help its resolved our issues by bundling slightly differently prior to creating the codepush update |
Hi, I am using code-push for application testing via testflight. Today I noticed that sometimes some images are not rendering. This is completely random => it happens once in a few minutes => image simply does not show (and after component rerender is triggered, image will show up). I was looking into my code, and couldn't find the answer why is this randomly happening.
Then I noticed that until app gets the update from code-push images are always rendering. As soon as it gets first, this random bug comes back. An update which app gets contains no changes to anything regarding image component (basically dummy update, just to confirm my claim).
I also tried cleaning code-push history, but still the same thing. No code-push updates => all ok...after first update, issue is here.
Do you have any idea what could be the problem? I tried various things as a workaround but so far nothing helped.
Thanks a lot.
The text was updated successfully, but these errors were encountered: