amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
423 stars 232 forks source link

Can't resolve 'amazon-cognito-auth-js' #42

Closed sam-jg closed 6 years ago

sam-jg commented 6 years ago

This is happening on a regular create react app, not related to typescript like #39.

deeperid commented 6 years ago

In package.json: "main": "lib/index.js", "module": "es/index.js", Are nowhere to be found in amazon-cognito-auth, so I used:

import { CognitoAuth } from 'amazon-cognito-auth-js/dist/amazon-cognito-auth';

To work around the incorrect values in package.json for now

jaxondu commented 6 years ago

Still encounter this error following the documentation. This issue should not be closed. If what you said is the right way to import, then please correct the documentation so that we do not waste time searching through all the past issues.

jaxondu commented 6 years ago

@yuntuowang Sorry I'm using VueJS. It is not common sense to have ES import in this manner. You must have export it wrongly.

yuntuowang commented 6 years ago

I have updated this workaround: import { CognitoAuth } from 'amazon-cognito-auth-js/dist/amazon-cognito-auth'; in our README.md.

bloomdido commented 6 years ago

The workaround/update to the README.md file seems to have reverted back in v1.1.1.

yuntuowang commented 6 years ago

Hi @bloomdido, we didn't include anything change about import SDK in v1.1.1. Do you mean that the workaround/update in the README.md doesn't work? Thanks.

bloomdido commented 6 years ago

The README file is incorrect.

import {CognitoAuth} from 'amazon-cognito-auth-js'

...doesn't work. The correct ES6 import is:

import {CognitoAuth} from 'amazon-cognito-auth-js/dist/amazon-cognito-auth'

This was correct in the README file until commit 1fbcae4d42480297bfa6bab77c47d8d6a51c5332.

yuntuowang commented 6 years ago

Thanks a lot for pointing this out!! @bloomdido I just updated README.md with the correct version.

sunsoori commented 6 years ago

which programming language is this https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ListUserPools.html Can you point to any sample code which uses this? I'm trying to use this in a lambda function.

engharb commented 5 years ago

@yuntuowang I have a problem in my Ionic+angular+typescript Mobile Project. I want to

import {CognitoAuth} from 'amazon-cognito-auth-js/dist/amazon-cognito-auth'

But it does not recognize it?

sam-jg commented 5 years ago

@engharb this is very old and closed issue and not related to typescript. I would recommend creating a new issue if you have not already.