Oleksandr
Oleksandr

Reputation: 113

The keyPrefix reduxPersist: is already in use

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

errorImage

Upvotes: 1

Views: 1833

Answers (2)

Pranjal Koshti
Pranjal Koshti

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

Oleksandr
Oleksandr

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

Related Questions