Reputation: 113
Pressing Cmd + I on ios simulator, I receive an error : "The keyPrefix reduxPersist: is already in use. Multiple clients cannot share the same keyPrefix. Provide a different keyPrefix in the offlineConfig object."
Im using appSyncClient and not using redux. Error refers to new AWSAppSyncClient
Upvotes: 1
Views: 1833
Reputation: 185
This issue occurs when multiple appsync clients are being created with same keyPrefix, lets say in a scenario while creating react app, if multiple rerenders are happening and client is created inside render function of class component, then client will be created multiple times and it will thow this error. Moving creating appsync client outside the react component solved this error for me.
Upvotes: 0
Reputation: 113
The problem was that when I create new AWSAppSyncClient, I have set "disableOffline" property to false, after I changed it, everything works as expected.
Upvotes: 5