-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Not working with rollup (includes fix) #888
Comments
nicer fix would be var _global = this || global; on the first line of IIFE body. |
Could you please merge it? |
for those finding this from the future, the modularization effort #3365 shipped in April 2020 and you can use Amplify with Rollup with a few small tweaks: https://dev.to/swyx/making-aws-amplify-work-with-rollup-2d9m |
I am getting a huge list of...
my rollup plugins include:
Using: |
@ioannist same here. Attempted to get a svelte app running with amplify, switched from rollup to webpack and still no luck. Compiling but getting a I know this issue is closed, but wondering if this needs more attention. Tried @sw-yx approach and couldn't get it working. Also saw the samples just recently posted but nothing on svelte or using rollup/webpack without a framework yet... hoping that changes! 😉 |
Facing the same errors when working on a svelte + amplify app like @escodel. I wanted to provide a fuller error output: 1 (same error and config as @ioannist , showing the error is Unresolved Dependencies)
I also have 3 other errors: 2
3
4
|
I get similar errors to @brianjychan . Can't seem to use aws-appsync because of this. |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Fails in browser with _global undefined when used with Rollup.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than AWS Amplify.
What is the expected behavior?
import of amazon-cognito-identity.js should work.
Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
All browsers appear to be affected, it happens with NPM packages rollup@0.58.2, amazon-cogito-identity-js@2.0.6
You can turn on the debug mode to provide more info for us by setting
window.LOG_LEVEL = 'DEBUG';
in your app.It appears to be a problem with the crypto-browserify module used by amazon-cogito-identity-js not conforming to CommonJS standards. The "rng.js" file needs to be modified as follows:
The new lines are:
The text was updated successfully, but these errors were encountered: