Open yorickr opened 7 years ago
+1
SyntaxError /Users/jschimmoeller/projects/eaddr/node_modules/aws-sdk-react-native-core/src/AWSCognitoCredentials.js: Unexpected token, expected , (48:57)
RCTFatal + 104 -[RCTBatchedBridge stopLoadingWithError:] + 1138 25-[RCTBatchedBridge start]_block_invoke_2 + 65 _dispatch_call_block_and_release + 12 _dispatch_client_callout + 8 _dispatch_main_queue_callback_4CF + 1054 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 __CFRunLoopRun + 2205 CFRunLoopRunSpecific + 420 GSEventRunModal + 161 UIApplicationMain + 159 main + 111 start + 1
I changed the brackets {} to () and got by it:
listener.addListener("LoginsRequestedEvent", async (callbackId) => {
const logins = [await Promise.resolve(this.getLogins())];
cognitoClient.sendCallbackResponse(callbackId, logins);
});
@jschimmoeller that doesn't destructure callbackId from the event though, so even though it's syntactically correct, it'll probably give you errors if it ever gets called.
@yorickr Your code fixed this for me: https://github.com/yorickr/aws-sdk-react-native/commit/f9e7a26daaff8ca54db729068b9d71eae7314155
@jschimmoeller that's how I fixed it. I didn't post a fix when I first encountered it because I thought it was my own babel issue.
Is AWS taking this project seriously? Doubtful, but hopeful.
I'm getting a syntax error on this line.
If I understand correctly, it's destructuring callbackId from event, then passing that on to the arrow function. However, is this the correct syntax? I've just updated to the latest React Native version, and it still gives me the error.
Would this fix it?