# Bug Fix: export 'Auth' (imported as 'Auth') was not found in 'aws-amplify'

## 1. Problem

<div data-full-width="true"><figure><img src="/files/H7m3YVO5TPE6uzFaCe0D" alt=""><figcaption></figcaption></figure></div>

* **line 8**: even though the code is there, the frontend container would still through the `undefined` error:&#x20;

{% code title="HomeFeedPage.js" lineNumbers="true" %}

```javascript
   const checkAuth = async () => {
    Auth.currentAuthenticatedUser({
      bypassCache: false
    })
    .then((user) => {
      console.log('user', user);
      return Auth.currentAuthenticatedUser()
    }).then((cognito_user) => {
      setUser({
        display_name: cognito_user.attributes.name,
        handle: cognito_user.attributes.preferred_username
      })
    })
    .catch((err) => console.log(err));
  }
```

{% endcode %}

## 2. Analysis

* It turns out, the upgraded version of `Amplify` was out. It's been more than 6 months since this Week 3 phase of development was out. As I'm starting all over again, I automatically got the latest version of 6.x.x when I ran `npm i`.

## 3. Solution

* [ ] Use the specific version Andrew used (`5.x.x`):

```diff
-    "aws-amplify": "^6.0.2",
+    "aws-amplify": "^5.0.16",
```

## 4. Result

* Amplify works correctly so throws the corresponding error correctly in the frontend.&#x20;
  * The Dev console error was gone.

<figure><img src="/files/pKIcYV5GczVAHp8tLvzy" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gwen-leigh.gitbook.io/free-aws-cloud-project-bookcamp/week-3-decentralised-authentication/bug-fix-export-auth-imported-as-auth-was-not-found-in-aws-amplify.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
