-
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
Cannot use aws-amplify module with rollup (Lit app) #10998
Comments
Hello, @bcbweb 👋. This looks related to #9639 regarding the aws-amplify package giving issues with some js build tools. While that's still an open issue/feature request, there was a workaround provided in the comments here. Not certain if creating a new |
To add to what @cwomack mentioned - I recently created an app using Rollup, and there were a few configuration nuances that were particular to Rollup. @bcbweb can you please share your current list of dependencies / devDependencies, as well as your |
@david-mcafee Apologies for the slow reply. I will try a temporary fix with @cwomack's suggestion, meanwhile here are my dependencies rollup config:
|
@cwomack To update you, I've tried the suggestions in that thread and they don't seem to resolve the issue. Added the resolve alias using the rollup plugin but I still see the "could not resolve" errors. |
Hi, any progress on this issue? |
@emendoza2, are you experiencing the same errors related to "os", "fs", "crypto", and "process" when serving? Can you share your @bcbweb, I've built a minimal Amplify + Rollup.js app that so far hasn't seen any build issues. Will be adding in your dependencies to see where it starts to break. |
I ran into the same exact problem as the original poster, I wrote a webapp with Lit, the starter kit comes by default with Rollup, then I spent time setting up the backend in AWS amplify, then hit this brick wall. It would be better if AWS Amplify said at the start that it has a hard dependency on webpack and not any other build tools like rollup, then I wouldn't have written code with an incompatible setup. |
Just unassigned this from me so that this can be picked up for reproduction (cc @cwomack) |
If anyone is reading this, my workaround was just to bite the bullet, surrender and convert my app to use webpack instead of rollup. Again, would have been nice to be told in the beginning that we need to use webpack. |
With the release of the latest major version of Amplify (aws-amplify@>6), this issue should now be resolved! Please refer to our release announcement, migration guide, and documentation for more information. Please let me know if you still encounter issues with version |
I'm going to mark this issue as resolved, if anyone following this issue is still having problems please let me know. |
Before opening, please confirm:
JavaScript Framework
Web Components / Lit
Amplify APIs
Not applicable
Amplify Categories
Not applicable
Environment information
Describe the bug
I have a web app using Lit for Web Components and I'm trying to serve/bundle using rollup, however I'm seeing issues with referencing "os", "fs", "crypto", and "process" when serving, plus other errors when trying to build.
Expected behavior
serving using @web/dev-server-rollup should work, building using rollup should work
Reproduction steps
I'm able to serve and build without problems, until I try to use the aws-amplify package in my front end code
Code Snippet
Log output
In browser when running serve:
When running build:
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: