Skip to content
This repository has been archived by the owner on Oct 12, 2018. It is now read-only.

Syntax error in AWSCognitoCredentials #20

Open
yorickr opened this issue Oct 27, 2016 · 6 comments
Open

Syntax error in AWSCognitoCredentials #20

yorickr opened this issue Oct 27, 2016 · 6 comments

Comments

@yorickr
Copy link

yorickr commented Oct 27, 2016

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?

@jschimmoeller
Copy link

+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

@jschimmoeller
Copy link

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);
  });

@yorickr
Copy link
Author

yorickr commented Nov 7, 2016

@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.

@eddanger
Copy link

eddanger commented Dec 6, 2016

@willks
Copy link

willks commented Dec 8, 2016

@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.

@kanerogers
Copy link

Sigh

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants