Open cloudpresser opened 3 years ago
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-plaid-link/index.js b/node_modules/react-native-plaid-link/index.js
index 4a4013e..90d423c 100644
--- a/node_modules/react-native-plaid-link/index.js
+++ b/node_modules/react-native-plaid-link/index.js
@@ -82,8 +82,11 @@ class PlaidAuthenticator extends Component {
}
}
*/
-
- this.props.onMessage(JSON.parse(e.nativeEvent.data));
+ try {
+ this.props.onMessage(JSON.parse(e.nativeEvent.data));
+ } catch (err) {
+ this.props.onMessage(e.nativeEvent.data)
+ }
};
}
When the WebView loads, it throws the error:
It seems like the error is cause because the plaid link page is running
window.postMessage
with a string containingsetImmediate$0
which is then passed to JSON.parse(e.nativeEvent.data), and since it is not valid JSON, it throws the error.