Error evaluating injectedJavaScript: This is possibly due to an unsupported return type. Try adding true to the end of your injectedJavaScript string.
See original GitHub issueHello,
We’re trying to migrate from react-native WebView. Replacing import { WebView } from 'react-native' with import { WebView } from 'react-native-webview' gives us this error when the component is mounted:
Error evaluating injectedJavaScript: This is possibly due to an unsupported return type. Try adding true to the end of your injectedJavaScript string.
I’ve tried to add ; true or ; return true at the end of the injected script but we still get the same error.
Do you know how we can fix it or identify the underlying problem?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:22
- Comments:30 (1 by maintainers)
Top Results From Across the Web
How to use RegExp in React-Native Webview's ...
When I use regexp in React-Native-Webview's injectedJavaScript prop, an error Unterminated regular expression literal error ...
Read more >Need help with react-native Webview, injecting react ... - Reddit
What should I do if I'm trying to pass data from react native into the javascript string that's executed by the webview? webviewRef.current....
Read more >WebView InjectedJavaScript - Expo Snack
Try this project on your phone! Use Expo's online editor to make changes and save your own copy.
Read more >humanoids/react-native-recaptcha - npm.io
Error evaluating injectedJavaScript : This is possibly due to an unsupported return type. Try adding true to the end of your injectedJavaScript string....
Read more >react-native-webview - UNPKG
... evaluating injectedJavaScript: This is possibly due to an unsupported return type. Try adding true to the end of your injectedJavaScript string.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed using a timer.
See your JS code carefully, this error is due to the fact that WebView can not execute JS code!