Closed dvarnai closed 2 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.
Hi :wave: Sorry this was auto-closed by stale bot. We are working towards preventing this from happening in the future.
I see you have found a workaround. Also feel free to open a PR and link it to this issue. I'll bring it to the attention of the UI team so they can either merge it or help refine the solution to address any potential edge cases.
@dvarnai We apologize for the late response to your issue request. We have recently launched a major version for @aws-amplify/ui-react@2.1.0, please let us know if you are still seeing the issue on your end. We are not able to reproduce it on our end, if you have any questions or suggestion, please reach out :)
Before opening, please confirm:
JavaScript Framework
Angular
Amplify APIs
Not applicable
Amplify Categories
Not applicable
Environment information
Describe the bug
When using Angular Universal, defineCustomElements method call throws an error due to window being undefined:
The bug is caused by the following line:
https://github.com/aws-amplify/amplify-js/blob/630d711fbcc1b339d1ae1169a6972e4f96aaf108/packages/amplify-ui-angular/src/amplify-module.ts#L61
Replacing the line with the following solves the issue and amplify UI seems to work just fine, however I'm not sure if this is the best approach:
The defineCustomElements method seems to do this check itself as well, however, the error seems to happen before the method is actually called.
Expected behavior
Angular UI should work with SSR
Reproduction steps
Use angular universal with amplify ui.
Code Snippet
Log output
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