No Auth module registered in Amplify after Fix #6811
See original GitHub issueDescribe the bug Fix #6811 has not fixed “No Auth module registered in Amplify” error
To Reproduce Steps to reproduce the behavior:
- Deleted
node_modules
folder andpackage-lock.json
file - Ran
npm install
- Ran
npm start
- 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:
- Created 3 years ago
- Reactions:2
- Comments:14 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ericclemmons I uninstalled all
aws-amplify
packages and reinstalled. Everything is working again. Thanks to everyone who contributed to this fix.Thanks for reporting this @benjeater, we will be digging into this today and providing an update as soon as we can