amazon-archives / aws-cognito-angular-quickstart

An Angular(v5)-based QuickStart single-page app utilizing Amazon Cognito, S3, and DynamoDB (Serverless architecture)
https://cognito.budilov.com
Apache License 2.0
689 stars 302 forks source link

Cannot read property 'CognitoUserAttribute' of undefined #64

Closed GuzmanPI closed 7 years ago

GuzmanPI commented 7 years ago

Hi guys. This is probably not an issue with this repo, but I wanted to contact you.

I have an Angular CLI app and I'm adding Cognito signup/login based on this project. However, I keep getting this error:

TypeError: Cannot read property 'CognitoUserAttribute' of undefined at UserRegistrationService

I do not know what I'm missing!

I have all the .js in assets/js folder

And I have added al the scripts in the index.

Thanks in advance for the help

vbudilov commented 7 years ago

Have you made any modifications to the original code?

GuzmanPI commented 7 years ago

I had an Angular CLI app already, and I'm trying to integrate Cognito.

I copied the JS folder into the assets folder, put the scripts in the index.html, and I copied the cognito.service.

I implemented the interface, and call the signup method from my component, but when it gets to de service It gives that error.

I think is something to do with the aws' sdk not being imported or something like that...

Thanks for your time!

vbudilov commented 7 years ago

There's a myriad of things that might be wrong, so I'm not sure where to begin. I would suggest you look at UserRegistrationService in an IDE (I suggest IntelliJ) and see what errors it's giving you...easier to debug that way.