Closed sam-jg closed 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
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.
@yuntuowang Sorry I'm using VueJS. It is not common sense to have ES import in this manner. You must have export it wrongly.
I have updated this workaround: import { CognitoAuth } from 'amazon-cognito-auth-js/dist/amazon-cognito-auth'; in our README.md.
The workaround/update to the README.md file seems to have reverted back in v1.1.1.
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.
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.
Thanks a lot for pointing this out!! @bloomdido I just updated README.md with the correct version.
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.
@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?
@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.
This is happening on a regular create react app, not related to typescript like #39.