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.

No Auth module registered in Amplify after Fix #6811

See original GitHub issue

Describe the bug Fix #6811 has not fixed “No Auth module registered in Amplify” error

To Reproduce Steps to reproduce the behavior:

  1. Deleted node_modules folder and package-lock.json file
  2. Ran npm install
  3. Ran npm start
  4. No data received from GraphQL endpoints and error in console

Expected behavior Data should be received from endpoints

Code Snippet App.js

import React, { Component, lazy, Suspense } from 'react';
import './App.css';

import Amplify from 'aws-amplify';
import awsconfig from './aws-exports';

Amplify.configure(awsconfig);
...

.aws-exports.js

/* eslint-disable */
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.

const awsmobile = {
    "aws_project_region": "eu-west-1",
    "aws_cognito_identity_pool_id": "eu-west-1:xxxx",
    "aws_cognito_region": "eu-west-1",
    "aws_user_pools_id": "eu-west-1_xxxx",
    "aws_user_pools_web_client_id": "xxxx",
    "oauth": {},
    "aws_appsync_graphqlEndpoint": "https://xxxx.appsync-api.eu-west-1.amazonaws.com/graphql",
    "aws_appsync_region": "eu-west-1",
    "aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS"
};

export default awsmobile;

SignIn Function

import { Auth } from 'aws-amplify';

export default function (payload) {
  return Auth.signIn(payload.inputUsername.toLowerCase(), payload.inputPassword);
}

getProjects.js (API call once logged in to populate home page)

import { API, graphqlOperation } from 'aws-amplify';
import * as Queries from '../../graphql/custom-queries';

export default function(username) {
  const query = {
    cognitoID: username
  }
  return API.graphql(graphqlOperation(Queries.getProjectsForHomePage, query));
}

custom-queries.js

export const getProjectsForHomePage = /* GraphQL */ `
  query GetProjectsForHomePage($cognitoID: String!) {
    userByCognitoID(cognitoID: $cognitoID) {
      items {
        projects {
          items {
            project {
              id
              projectName
              projectDescription
              projectStatus
              projectAvatar
              createdAt
              teamMembers {
                items {
                  isAdministrator
                  attendee {
                    id
                    accreditations {
                      items {
                        expiryDate
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
`;

package.json

  "dependencies": {
    "@aws-amplify/auth": "^3.4.4",
    "@aws-amplify/core": "^3.5.4",
    "@aws-amplify/pubsub": "^2.1.9",
    "aws-amplify": "^3.3.1",
    "aws-amplify-react": "^4.2.5",
    ...
  },

Screenshots

Console before user logs in Image

Console after user logs in and API calls are made Image

What is Configured? Configured Amplify Parts

  • Auth
  • API
  • Functions x 4

All configured through Amplify CLI

Additional context The problem occurred after reinstalling node_modules folder. I have another Mac that has the same project installed and that is still working after pulling the latest commit from Git.

@aws-amplify/api: v3.2.4
@aws-amplify/api-graphql: v1.2.4
@aws-amplify/auth: v3.4.4
@aws-amplify/core: v3.5.4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
benjeatercommented, Sep 28, 2020

@ericclemmons I uninstalled all aws-amplify packages and reinstalled. Everything is working again. Thanks to everyone who contributed to this fix.

2reactions
sammartinezcommented, Sep 21, 2020

Thanks for reporting this @benjeater, we will be digging into this today and providing an update as soon as we can

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - Upgrading Amplify packages - JavaScript
No Auth module registered in Amplify. To prevent this situation, you can Check for duplicate versions, and if duplicate versions exists, then Upgrade...
Read more >
Getting a No Credentials error when trying to use Storage.put()
So, I am putting it here the steps to solve this problem, ... import Storage from '@aws-amplify/storage'; export function configureAmplify() ...
Read more >
@aws-amplify/core | Yarn - Package Manager
Any calls to Amplify.Auth , Amplify.Cache , and Amplify.ServiceWorker are no longer supported. Instead, your code should use the named exports. For example:...
Read more >
Troubleshooting Amplify identity and access
Use the following information to help you diagnose and fix common issues that you might encounter when working with Amplify and IAM. If...
Read more >
How to use the @aws-amplify/auth.federatedSignIn function in ...
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... 'function' ) { throw new...
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