-
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
Removal of Polyfill leads to window is not defined error in React web app with SSR #1770
Comments
I have the same issue, this change has broken server side rendering because window.localStorage does not exist. |
I have the same issue. And window is poluted, so style-jsx think its client side and goes wild. |
Same issue here, it was working fine previously, I am using SSR as well and invoke the Amplify methods on componentDidMount() with the same error. |
Related to #1811 |
@haverchuck I have tried using it inside componentDidMount, but still throws error. Let us know what you would recommend. Cheers! 🥂 |
This seems to be fixed in the latest unstable via https://github.com/aws-amplify/amplify-js/pull/1802/files |
@dhanesh-kapadiya - Does this error surface when you use the unstable build (using the @unstable tag on an npm install)? |
No, I only used stable version, which installed core@1.0.13-unstable.1 through yarn, that update have this error, after that I couldn't get a chance to test new releases again. I'll update my project with the latest unstable build of amplify and I'll update you on this issue as soon as I can. Thanks man.🥂 |
I was able to resolve the issue by installing the
@haverchuck -- Will this be rolled out to a stable version soon? |
@haverchuck I have tested the unstable build in my project and it seems to be working. And I've checked latest stable build as well, that seems to be working too. |
Great! Let us know if you need to reopen this. |
Wait, it's working with "1.1.6-unstable.2" but it does not with "1.1.9". |
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 |
After this update
core@1.0.13-unstable.1
We are getting window is not defined error.
Error points to ../../src/RNComponents/index.ts
we are using custom aws config setup.
we have set Amplify.configure(awsConfig) in redux provider wrapper file which executes amplify configure function outside of react component, I have also tried to call the Amplify.configure in componentDidMount function but still getting same error.
In older version of our project,
we were using core@1.0.9, and it is working perfectly.
This is how our project setup is,
This Provider.js component is imported inside all the pages to check user authentication.
provider.js
awsConfig.js
If we are doing something wrong, please guide us to make correction in our project by providing best practice for the usage of Amplify.configure function.
The text was updated successfully, but these errors were encountered: