Amplify-js: On Edge TypeError: Failed to execute 'fetch()' on 'Window': Invalid argument with Hosted UI

Created on 4 Jun 2019  路  3Comments  路  Source: aws-amplify/amplify-js

Describe the bug
In Edge, when I use the Hosted UI I have the following error:
"Uncaught (in promise): TypeError: Failed to execute 'fetch()' on 'Window': Invalid argument.

To Reproduce
Steps to reproduce the behavior:

  1. Install and configure the Hosted UI
  2. Click on Hosted UI button
  3. See error

Expected behavior
No error on Edge after using Hosted UI.

Screenshots
Failed to execute fetch

Desktop (please complete the following information):

  • OS: Windows 10

Additional context
The problem occurs only on Edge. I have no problem on Chrome, Safari or even IE11.

Sample code

export class AppComponent implements OnInit {

  ngOnInit() {
    Hub.listen('auth', (data) => {
      const { payload } = data;
      this.onAuthEvent(payload);
    });
  }

  onAuthEvent(payload: any) {
    switch (payload.event) {
      case 'signIn':
        console.log('signIn');
        break;
      case "signOut":
        console.log('signOut');
        break;
    }
  }

  onHostedUI() {
    Auth.federatedSignIn();
  }

  onSignOut() {
    Auth.signOut();
  }
}
Auth Cognito Service Team bug

Most helpful comment

Any movement on this? or is there a work around? I have tried some polyfills but no luck. I currently have this issue and can't release latest build with amplify integration until it is resolved. However, I don't want to remove amplify completely because of this issue, but will have to if I see no movement.

All 3 comments

Any movement on this? or is there a work around? I have tried some polyfills but no luck. I currently have this issue and can't release latest build with amplify integration until it is resolved. However, I don't want to remove amplify completely because of this issue, but will have to if I see no movement.

Update "aws-amplify" to version 1.1.36.

This version has the following fix:
-fix(@aws-amplify/core): Edge browser misidentified as Chrome (#3807)

@gustavo-luis-bsd Thanks for the information. I close the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

romainquellec picture romainquellec  路  3Comments

TheRealRed7 picture TheRealRed7  路  3Comments

ddemoll picture ddemoll  路  3Comments

DougWoodCDS picture DougWoodCDS  路  3Comments

guanzo picture guanzo  路  3Comments