Skip to content

Unable to call fromCognitoIdentityPool on iOS (browser) - crashes #6542

@raRaRa

Description

@raRaRa

Checkboxes for prior research

Describe the bug

I just noticed that Chrome on iOS devices fails when calling fromCognitoIdentityPool. But it works on my desktop machine just fine with Chrome and Safari.

Example code:

  this.cachedCredentials = await fromCognitoIdentityPool({
      // Required. The unique identifier for the identity pool from which an identity should be
      // retrieved or generated.
      identityPoolId: this.options.IdentityPoolId,
      clientConfig: { region: this.options.Region },
  })();

The error I get:

DEBUG endpoints Resolving endpoint from template: {
  "url": "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",
  "properties": {},
  "headers": {}
}

ERROR TypeError: JSON.stringify cannot serialize cyclic structures

Expected Behavior

I expect it to run through the last step where it errors out, which should log:

endpoints Resolved endpoint: {
  "headers": {},
  "properties": {},
  "url": "https://cognito-identity.eu-west-1.amazonaws.com/"
}

Current Behavior

Currently it errors on

DEBUG endpoints Resolving endpoint from template: {
  "url": "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",
  "properties": {},
  "headers": {}
}

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/credential-providers 3.664.0

Which JavaScript Runtime is this issue in?

Browser

Details of the browser/Node.js/ReactNative version

Latest Chrome on iOS - Chrome: 129.0.6668.90

Reproduction Steps

Call fromCognitoIdentityPool from Chrome in iOS

Observed Behavior

This error comes: ERROR TypeError: JSON.stringify cannot serialize cyclic structures

Expected Behavior

I expect this to log out:

endpoints Resolved endpoint: {
  "headers": {},
  "properties": {},
  "url": "https://cognito-identity.eu-west-1.amazonaws.com/"
}

Possible Solution

N/A

Additional Information/Context

N/A

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.closed-for-stalenessp2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions