New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No userPool" error starting at aws-amplify@0.1.45 #854

Closed
jchang10 opened this Issue May 17, 2018 · 16 comments

Comments

Projects
None yet
@jchang10
Copy link

jchang10 commented May 17, 2018

Updated: Sorry, I mixed up the names and versions of aws-amplify and aws-amplify-react. aws-amplify has the versions 0.1.45, etc. aws-amplify has the versions 0.3.x and 0.4.x. Sorry for the confusion.

I just did an update on my dependencies. Noticed I could no longer authenticate with Cognito/aws-amplify/aws-amplify-react. Something in FederatedSignin.js render() method is throwing the "No userPool" error for some reason. If i downgrade to aws-amplify-react@0.1.44, things work.

Specifically, I tracked it down as far as aws-amplify/Auth/AuthClass. For some reason, it is losing its configuration in FederatedSignin.js. All config values are undefined by the time it gets called here in this module.

Looks like there were some major changes between these 2 versions as well. Dependencies changed so that 0.1.45 depends on aws-amplify-react@0.4.0 now. These changes were made just a couple days ago. Just want to report the issue here at least. Unfortunately, perfect timing to get tripped up with this just now.

Thanks,
Jae

Working:
├─ aws-amplify-react@0.1.44
├─ aws-amplify@0.3.4

Broken:
├─ aws-amplify-react@0.1.45
│ ├─ aws-amplify@^0.4.x
│ ├─ aws-amplify@0.4.0

ConsoleLogger.js:100 {[DEBUG] 07:10.752 Amplify - amplify config: {…}}
ConsoleLogger.js:84 [DEBUG] 07:10.753 I18n - configure I18n
ConsoleLogger.js:84 [DEBUG] 07:10.753 I18n - create I18n instance
ConsoleLogger.js:84 [DEBUG] 07:13.507 AuthClass - configure Auth
ConsoleLogger.js:100 {[DEBUG] 07:13.507 Parser - parse config: Array(3)}
ConsoleLogger.js:100 {[DEBUG] 07:13.508 Analytics - on hub capsule auth: {…}}
ConsoleLogger.js:84 [DEBUG] 07:13.508 AnalyticsClass - configure Analytics
ConsoleLogger.js:100 {[DEBUG] 07:13.510 Parser - parse config: Array(3)}
ConsoleLogger.js:84 [DEBUG] 07:13.510 AuthClass - getting current credntials
ConsoleLogger.js:84 [DEBUG] 07:13.510 AuthClass - picking up credentials
ConsoleLogger.js:84 [DEBUG] 07:13.512 AuthClass - getting old cred promise
ConsoleLogger.js:84 [DEBUG] 07:13.513 Storage - configure called
ConsoleLogger.js:84 [DEBUG] 07:13.513 StorageClass - configure Storage
ConsoleLogger.js:84 [DEBUG] 07:13.514 StorageClass - configure Storage
ConsoleLogger.js:100 {[DEBUG] 07:13.514 PubSub - configure PubSub: {…}}[DEBUG] 07:13.514 PubSub - configure PubSub: opt: {aws_app_analytics: "enable", aws_auth_facebook: "enable", aws_cognito_identity_pool_id: "us-west-2:44a30419-a324-46c6-94d6-d2ef2b3df6d7", aws_cognito_region: "us-west-2", aws_content_delivery: "enable", …}__proto__: Object__proto__: Object
ConsoleLogger.js:100 {[DEBUG] 07:13.514 API - configure API: {…}}
ConsoleLogger.js:84 [DEBUG] 07:13.515 API - create API instance
ConsoleLogger.js:100 {[DEBUG] 07:13.515 RestClient - API Options: {…}}[DEBUG] 07:13.515 RestClient - API Options: {aws_app_analytics: "enable", aws_auth_facebook: "enable", aws_cognito_identity_pool_id: "us-west-2:44a30419-a324-46c6-94d6-d2ef2b3df6d7", aws_cognito_region: "us-west-2", aws_content_delivery: "enable", …}__proto__: Object
ConsoleLogger.js:84 [DEBUG] 07:13.528 Hub - noname listening auth
ConsoleLogger.js:84 [DEBUG] 07:13.544 AuthClass - getting current authenticted user
ConsoleLogger.js:84 [INFO] 07:13.544 Cache - Get item: key is federatedUser with options undefined
ConsoleLogger.js:84 [DEBUG] 07:13.550 AuthClass - get current authenticated userpool user
ConsoleLogger.js:100 {[DEBUG] 07:13.550 AuthClass - getting session failed: "No current user"}
ConsoleLogger.js:84 [DEBUG] 07:13.552 AuthClass - setting credentials for guest


@mlabieniec

This comment has been minimized.

Copy link
Collaborator

mlabieniec commented May 17, 2018

@jchang10 apologies for the issues on the upgrade here. There were a few major dependency updates we had to take due to some security vulnerabilities in the versions of crypto-browserify. We haven't seen any issues in testing though so far related to this. Sometimes with this error the issue is that the wrong version of aws-amplify-react is being consumed by aws-amplify. We are working on a modularization and scoping that will help ultimately solve this problem better but right now sometimes the solution is (due to some npm caching sometimes) to clear out your node_modules and do a fresh npm/yarn install. Are you using the social login in this app e.g. login with google/facebook via the Authenticator or similar?

@mlabieniec

This comment has been minimized.

Copy link
Collaborator

mlabieniec commented May 17, 2018

@jchang10 i just tested a react app using a previous version of both packages and ran a

yarn add aws-amplify
yarn add aws-amplify-react

which gave me:
"aws-amplify": "^0.4.0",
"aws-amplify-react": "^0.1.46",

I didn't have any issues logging in via user pools or social. Let me know if clearing cache/npm modules helped or if there is something different I can test out.

@thelinuxkid

This comment has been minimized.

Copy link

thelinuxkid commented May 17, 2018

I had the same "No userPool" error. Downgrading to these two versions fixed it.

    "aws-amplify": "^0.4.0",
    "aws-amplify-react": "^0.1.46",
@jchang10

This comment has been minimized.

Copy link
Author

jchang10 commented May 17, 2018

@mlabieniec Thanks for the update. Unfortunately, clearing node_modules did not help in my case. In fact, I was not looking upgrade aws-amplify(-react) on purpose. I was fixing something else and so I was clearing and rebuilding my node_modules cache, and that is when I noticed Auth stopped working for me. After further investigating, I realized there were some major upgrades to aws-amplify, etc.

Okay, interesting that your test is working for you. One special case on my side is that I am using aws-appsync(-react) as well. However, now It looks like AppSync has been merged into aws-amplify now as well, instead of being its own separate module. Not sure what conflicts that could mean.

I have
aws-appsync-react@1.0.6 latest is 1.0.11
aws-appsync@1.0.19 latest is 1.0.20

I will try and do more testing on my side as well.

@setuk

This comment has been minimized.

Copy link

setuk commented May 26, 2018

@jchang10

This comment has been minimized.

Copy link
Author

jchang10 commented Jun 1, 2018

@setuk thanks for the update. Yes, working now. I just upgraded to the latest versions.

Previously, the error occured with:
"aws-amplify": "^0.4.0",
"aws-amplify-react": "^0.1.46",

Working now with:
├─ aws-amplify-react@0.1.47
│ ├─ aws-amplify@^0.4.1
├─ aws-amplify@0.4.1

@jchang10 jchang10 closed this Jun 1, 2018

@avcohen

This comment has been minimized.

Copy link

avcohen commented Jul 2, 2018

@mlabieniec i'm aware this was closed but i seem to be having some difficulty getting past this error despite dropping back to aws-amplify@0.4.1 and aws-amplify-react@0.1.47 as noted by @setuk as well as aws-amplify@0.4.0 and aws-amplify-react@0.1.46 as noted by @thelinuxkid.

my implementation doesn't use awsmobile to generate an aws config file - doing this manually via ~/config.js as per a tutorial. i have confirmed the user i'm attempting to use is CONFIRMED and the userPoolId is associated with the correct identityPoolId.

my repo is here for reference.

@segheysens

This comment has been minimized.

Copy link

segheysens commented Jul 6, 2018

@avcohen I'm experiencing the same - have you found any resolution? I had my app working up until yesterday but I can't find what I might have changed recently that would have impacted this.

"aws-amplify": "^0.4.4",
"aws-amplify-react-native": "^0.2.15",
@avcohen

This comment has been minimized.

Copy link

avcohen commented Jul 6, 2018

@segheysens sadly, no. i've actually stepped away from this project for a moment but will be diving back in shortly - probably backup a few steps and set things up using the awsmobile cli to see if i have any luck. will follow up should i get things straightened out.

@RadoAz

This comment has been minimized.

Copy link

RadoAz commented Jul 11, 2018

The same problem... After reinstalled node_modules began to throw No userPool ... I tried everything... No luck...

@segheysens

This comment has been minimized.

Copy link

segheysens commented Jul 13, 2018

This was an incredibly simple mistake for me - I wasn't properly exporting my AWS connection object (typically store in aws-exports.js for Amplify). Once I added the export statement, everything was working again!

@jbeard4

This comment has been minimized.

Copy link

jbeard4 commented Aug 16, 2018

@avcohen installing aws-amplify@0.4.0 and aws-amplify-react@0.1.46 seemed to resolve this problem for me

@meatherly

This comment has been minimized.

Copy link

meatherly commented Sep 25, 2018

This also happens on:

aws-amplify@1.1.3
aws-amplify-react@2.0.4
@deankostomaj

This comment has been minimized.

Copy link

deankostomaj commented Dec 26, 2018

In my case I forgot to add

import Amplify from 'aws-amplify';
import AppSync from './aws-exports.js';

Amplify.configure({
    Auth: AppSync
});

in index.js

@rcbrown

This comment has been minimized.

Copy link

rcbrown commented Jan 6, 2019

Still receiving "No userPool" error on:

"aws-amplify": "^1.1.18",
"aws-amplify-react": "^2.2.5",

This is vanilla npx create-react-app appname, amplify configure, amplify init, amplify add auth (with a facebook app id), and withAuthenticator around App component.

@rcbrown

This comment has been minimized.

Copy link

rcbrown commented Jan 6, 2019

Oops, my bad--it's because I hadn't called Amplify.configure(). That error message could be better, but ultimately all my fault.

Still receiving "No userPool" error on:

"aws-amplify": "^1.1.18",
"aws-amplify-react": "^2.2.5",

This is vanilla npx create-react-app appname, amplify configure, amplify init, amplify add auth (with a facebook app id), and withAuthenticator around App component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment