-
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
TypeError: Cannot use 'in' operator to search for 'method' in 9 #518
Comments
@vmarquet Docs never specified you syntax should have worked which is why you encountered that issue. Regarding
If you think changes need to be done in a repository, please submit a pull request, since you already spent time to track the bug, it's even more enjoyable. |
@Titozzz This answer is a bit weird, as the code clearly tries to accept an Image identifier, but a bug precedes that piece of code and prevents it. So it clearly is a bug, no matter what the docs say... |
You usually want to base your code on how it is documented, not implemented because the implementation can change any time |
@Titozzz Because the documentation cannot change? Do you really expect people to read the entire documentation and notice the api changes at every update? No, that's why you should not drop features silently, that's why properly managed projects have a changelog file, but there is none in this repository. |
I am also experiencing this issue after moving from the WebView in react-native to this WebView. If I change this line as follows. - if (source && 'method' in source) {
+ if (typeof source !== 'number' && source && 'method' in source) { Then the problem goes away. However, then I simply run into this bug instead. If |
This should be reopened and looked into @Titozzz |
Here's a workaround we used to get around this issue after upgrading from Expo 32 (which includes the react-native webview) to Expo 33 (which includes react-native-webview): 1/ Create a Webpack setup that bundles our local HTML, JS, CSS and icons fonts into a single self-contained HTML file. In case this is useful to anyone I've shared the script and the Webpack setup in a Gist here: https://gist.github.com/paldepind/8cbc430575cd075144d291b0eff463fc |
@paldepind what happens if you use
? |
@Titozzz Thank you for the comment and the great work you do on react-native-webview. Using |
Thanks a lot for sharing this @paldepind! It’s been two years and there’s been a lot of updates to this repo. I’d be curious to hear if your approach still works for you? |
I had this code working in version 5.0.1:
and in 5.7.0, it crashes on Android (still works on iOS):
I'm assuming that it happens because of this line, introduced by the js to ts rewrite (this commit).
It seems the author of this rewrite forgot to handle using
require
in thesource
prop.I'm currently bypassing the problem this way:
This should be fixed though and a test should be added to ensure it doesn't happen again.
The text was updated successfully, but these errors were encountered: