-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Using the npm module in the browser #789
Comments
Hi @nowakj, Have you tried using our script package for the browser? You can find more on how to use it in our user guide. |
Hi jeskew, I am able to use the packaged files that come in the 'dist' directory just fine. Thanks, |
There was some discussion on how to use the SDK with webpack in #603. A few solutions were proposed, but I'm not sure if they'd work for everyone. Webpack support seems pretty popular so I'm going to mark this ticket as a feature request and keep it open for now. |
I was able to solve the problems described in #603, so the module loads fine. but than fails at runtime as the CognitoIdentity service is not loaded. |
Indeed, it would be really beneficial if the SDK was updated rather than us having to work around specific issues by trial and error. |
Support for webpack was added in version 2.6.0 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Hi,
I ma trying to use the aws-sdk module in the browser (with webpack) by doing:
var AWS = require('aws-sdk');
When I try to get Cognito credentials it fails with the following error:
TypeError: AWS.CognitoIdentity is not a function
at CognitoIdentityCredentials.AWS.CognitoIdentityCredentials.AWS.util.inherit.createClients
at CognitoIdentityCredentials.refresh
at CognitoIdentityCredentials.get
It seems that it is not initialising the CognitoIdentity service.
If I require the dist file it works fine:
require('../../node_modules/aws-sdk/dist/aws-sdk');
but I would like to require the module instead of the specific file.
Is there any way to make this work with the module require?
Thanks
The text was updated successfully, but these errors were encountered: