-
Notifications
You must be signed in to change notification settings - Fork 3k
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
window.ReactNativeWebView.postMessage is not a function #2680
Comments
You would also get that error if |
We have the same the issue, reported by Bugsnag for Android devices. |
Same here, seems to happen when page takes long time/fails to load |
Can we get this fixed? I'm still seeing this |
@17Amir17 Based on the limited information thus far, this sounds like an issue with Android's WebView that this library can't do anything about. I could be wrong, but we don't have a repro and the info from @jackkinsella indicates that we are successfully invoking I would be somewhat curious if |
I have same issue on 11.25.1. |
We have Expo 47 and From our estimation this happens to about 1% of users on Android. In our case the user can't even login in the app if the webview connection is not working well, so we constantly receive 1* reviews on the store. Anyone here found a fix? Seems like the issue happens across a wide range of devices and android versions so I couldn't tell if there's some special condition. |
Any updates on this? Im using version 11.626.0 and im using a ref for the viewer.
|
@adambeer |
I think 90% of the problem in this case is actually making a reproducible example which I tried to do today and failed. |
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
Can it be about the WebView process being killed by the OS on Android, i.e., running out of memory or inactive for a period? It seems that after onRenderProcessGone is called, postMessage will be missing. And reload() doesn't help. Changing the WebView's key prop if onRenderProcessGone is called seems to fix the issue. When the WebView process is killed and recreated, is something missing causing postMessage not a function? |
Bug description:
I'm getting a strange (and relatively rare) exception reported in Sentry.
This exists within a piece of code that explicitly checks if
window.ReactNativeWebView
is presentTo Reproduce:
Because it happens rarely, I can't give exact reproduction steps.
However:
This appears to be sporadic, even for any given user. I.e. they will experience the bug briefly then it won't happen again.
Environment:
Remarks
window.ReactNativeWebView
needs time to load its properties?window.ReactNativeWebView
behaves differently depending on the OS/environment the code finds itself executed in? It seems likepostMessage
is a value instead of a function here.The text was updated successfully, but these errors were encountered: