Open ramyodev opened 3 months ago
Hmm, that sounds interesting. I wasn’t able to reproduce it using Hermes and the specified version of React Native (0.74.3).
Could you provide more details about your environment? Specifically, which engine you’re using, the Node version, and so on?
@prsvic I will try to provide you with a minimal reproducible example asap. For now we patched it like so:
@dialectlabs+blinks-core+0.12.1.patch
diff --git a/node_modules/@dialectlabs/blinks-core/dist/index.cjs b/node_modules/@dialectlabs/blinks-core/dist/index.cjs
index 12ad4e1..9d395d3 100644
--- a/node_modules/@dialectlabs/blinks-core/dist/index.cjs
+++ b/node_modules/@dialectlabs/blinks-core/dist/index.cjs
@@ -1493,11 +1493,7 @@ function useAction({
}).catch((e) => {
console.error("[@dialectlabs/blinks-core] Failed to fetch action", e);
setAction(null);
- }).finally(() => {
- if (!ignore) {
- setIsLoading(false);
- }
- });
+ })
return () => {
ignore = true;
};
Will provide you with more info soon.
Issue Summary
A TypeError occurs within the
useAction
hook of the Blinks SDK when attempting to use afinally
block after a promise chain.Steps to Reproduce
useAction
hook.useAction
hook.Error Message
Code Snippet
Suggested Fix
Removing the
finally
block resolves the error and allows the component to function, but this is not ideal. A better fix would be to ensure that the Promise implementation in the environment includesfinally
or to add a polyfill.Environment
0.74.3
react-native-picker-select
version:^9.1.3
@dialectlabs/blinks
version:^0.8.0
@dialectlabs/blinks-react-native
version:^0.2.0