Amplify-js: Modularization - User pool client XXX does not exist.

Created on 2 Aug 2018  路  2Comments  路  Source: aws-amplify/amplify-js

Do you want to request a feature or report a bug?
bug

What is the current behaviour?
I have the following code:

// index.ts

import { setupAuth } from './core/service';

setupAuth();
...
// core/service.ts

import { AWSAmplifyAuthOptions, setupAwsAmplifyAuth } from '../libs/auth';
import { config } from './config';

const awsAmplifyConfig: AWSAmplifyAuthOptions = {
  Auth: {
    identityPoolId: config.AWS_IDENTITY_POOL_ID,
    region: config.AWS_REGION,
    userPoolId: config.AWS_USER_POOL_ID,
    userPoolWebClientId: config.AWS_USER_POOL_WEB_CLIENT_ID
  }
};

export const setupAuth = () => {
  setupAwsAmplifyAuth(awsAmplifyConfig);
};



md5-6ecc85dc35c04be43f60ab8f03212799



```js
// login.ts

import Auth from '@aws-amplify/Auth';

export const signIn = () => {
  if (!Auth || typeof Auth.signIn !== 'function') {
    throw new Error('No Auth module found, please ensure @aws-amplify/auth is imported');
  } else {
    console.log('Auth-signIn', Auth);
  }

  Auth.signIn()...
}

The first issue is that Auth has the correct data inside the object

afad

and it never throws the error No Auth module found..., but every time I am trying to SignIn the response is User pool client XXXX does not exist.

What is the expected behaviour?
Not throw the error.

Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
1.0.4

Most helpful comment

How do you solve it? Thanks

All 2 comments

The user pool was recreated due to an update in the CloudFormation stack. This meant the user pool IDs had changed which is why I was unable to communicate with cognito vis Amplify.

How do you solve it? Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheRealRed7 picture TheRealRed7  路  3Comments

callmekatootie picture callmekatootie  路  3Comments

leantide picture leantide  路  3Comments

karlmosenbacher picture karlmosenbacher  路  3Comments

ldgarcia picture ldgarcia  路  3Comments