question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to fetch unauthenticated user on chrome

See original GitHub issue

Describe the bug currentCredentials returns a failed to fetch error due to net::ERR_BLOCKED_BY_RESPONSE

To Reproduce Steps to reproduce the behavior:

  1. call Auth.currentCredentials() without being authenticated on chrome 84
  2. See error: Failed to fetch

Debug logs

[DEBUG] 30:51.530 AuthClass - getting current credentials
ConsoleLogger.js:97 [DEBUG] 30:51.530 Credentials - getting credentials
ConsoleLogger.js:97 [DEBUG] 30:51.530 Credentials - picking up credentials
ConsoleLogger.js:97 [DEBUG] 30:51.530 Credentials - getting new cred promise
ConsoleLogger.js:97 [DEBUG] 30:51.530 Credentials - checking if credentials exists and not expired
ConsoleLogger.js:97 [DEBUG] 30:51.530 Credentials - need to get a new credential or refresh the existing one
ConsoleLogger.js:97 [DEBUG] 30:51.530 AuthClass - Getting current user credentials
ConsoleLogger.js:107 [DEBUG] 30:51.531 AuthClass - failed to get or parse item aws-amplify-federatedInfo SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at AuthClass.<anonymous> (Auth.js:1270)
    at step (Auth.js:44)
    at Object.next (Auth.js:25)
    at fulfilled (Auth.js:16)
ConsoleLogger.js:97 [DEBUG] 30:51.531 AuthClass - Getting current session
ConsoleLogger.js:97 [DEBUG] 30:51.537 Credentials - getting credentials
ConsoleLogger.js:97 [DEBUG] 30:51.537 Credentials - picking up credentials
ConsoleLogger.js:97 [DEBUG] 30:51.537 Credentials - getting old cred promise
ConsoleLogger.js:97 [DEBUG] 30:51.642 AuthClass - Failed to get user from user pool
ConsoleLogger.js:107 [DEBUG] 30:51.644 AuthClass - Failed to get the current user No current user
ConsoleLogger.js:107 [DEBUG] 30:51.644 AuthClass - getting session failed No current user
ConsoleLogger.js:97 [DEBUG] 30:51.644 Credentials - setting credentials for guest
VM12:1 POST https://cognito-identity.eu-west-1.amazonaws.com/ net::ERR_BLOCKED_BY_RESPONSE
ConsoleLogger.js:107 [DEBUG] 30:52.85 Credentials - Failed to load credentials Promise {<rejected>: TypeError: Failed to fetch}
ConsoleLogger.js:107 [DEBUG] 30:52.85 Credentials - Error loading credentials TypeError: Failed to fetch
App.tsx:87 Credentials:  TypeError: Failed to fetch
ConsoleLogger.js:107 [DEBUG] 30:52.85 AWSS3Provider - set credentials for storage {accessKeyId: undefined, sessionToken: undefined, secretAccessKey: undefined, identityId: undefined, authenticated: undefined}
ConsoleLogger.js:97 [DEBUG] 30:52.86 AWSS3Provider - get test.txt from public/test.txt

Expected behavior Auth.currentCredentials should work with unauthenticated user

The error seems inconsistent it temporally works: by clearing the browser cache and in incognito mode

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
BenoitDelcommented, Aug 24, 2020

here you go: bug #1116990.

0reactions
github-actions[bot]commented, Aug 27, 2021

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Failed to fetch service account token - Google Groups
It appears that metadata server could be busy or is down so that ESP failed to connect to it to get the access...
Read more >
Authorization Errors | Device Access - Google Developers
When attempting to get an access or refresh token, you will get an "Invalid client" error if you provide an incorrect OAuth 2.0...
Read more >
My users are not able to access the app - AppSheet Help
If a user can't access your app, there are three possible reasons for the problem: The app itself is not runnable: When there's...
Read more >
Google Chrome failing to fetch pages from one specific site on ...
Since it's only one user and only one site, it's possible that some cookie has been corrupted or otherwise is causing the issue....
Read more >
Uncaught (in promise) Type Error when trying to fetch for URL
Once the server was running, I went to Google Chrome and when to inspect ... (in promise) TypeError: Failed to fetch at <anonymous>:1:1....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found