Removal of Polyfill leads to window is not defined error in React web app with SSR
See original GitHub issueAfter 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
import React, { Component } from 'react'
import { Provider } from 'react-redux'
import store from '../store'
import { Auth } from 'aws-amplify'
import '../../awsConfig.js'
export default class ProviderWithAuth extends Component {
...
}
awsConfig.js
import Amplify from 'aws-amplify';
import { default as config } from '../../config'
Amplify.configure({ config })
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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:13 (3 by maintainers)
Top GitHub Comments
@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.
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
*-help
channels or Discussions for those types of questions.