Describe the bug
When using 'AMAZON_COGNITO_USER_POOLS' as authentication type. API.graphql(...) subscription will failed.
Error:
TypeError: In this environment the sources for assign MUST be an object. This error is a performance optimization and not spec compliant.
I look into the source code and this error is coming from API.js line 564:
additionalheaders = __assign({},
(authenticationType === 'API_KEY' && {'x-amz-subscriber-id': this.clientIdentifier}));
Since the authenticationType is 'AMAZON_COGNITO_USER_POOLS', the second argument will be false thus causing the Object assign TypeError.
I can subscribe to appsync successfully after commented out the code above.
This error only occured on React Native project.
I have same code running on Web based React project without any issue.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Subscribe to appsync subscription successfully
Environment:
MacOS 10.14
xcode 10.1
Project dependency:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Check out my thread https://github.com/aws-amplify/amplify-js/issues/2023
I reproduced the problem on the simulator, working on PR to fix the problem
@derrenw is available a new unstable version. I've just tried it, and is working for me.
[email protected]
@elorzafe sorry for late reply. i confirm this issue have been resolved in latest [email protected] release. Thanks for the support!