简体   繁体   中英

Firestore persistence (web) issue

I'm working locally with Firestore for the web (Firebase version 9.8.2) and am trying to enable persistence. This works fine on initial page load, and also on refreshes, but once the source code is changed (even a trivial change like changing the text content of a DOM node), I receive the following error after calling enableIndexedDbPersistence :

Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using experimentalForceOwningTab:true , make sure that only one tab has persistence enabled at any given time.

This same error occurs in the same way even if experimentalForceOwningTab:true is set.

According to the API Reference docs for enableIndexedDbPersistence , the property is now called forceOwnership (not experimentalForceOwningTab ). This works!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM