无法在'IDBObjectStore'上执行'put':函数(root).... upda ... <omitted> ...}无法克隆

时间:2019-07-25 07:47:06

标签: indexeddb localforage angular-akita

我正在将Akita Statemanagementment用于Angular Application。并且我已经创建了两个具有localForage配置的商店,其驱动程序为IndexedDB,名称为Akita,StoreName为“ AppDataStore”。并且Store key是商店的名称。

以下是版本,商店配置。

objectStore localforage configuration:
Store1:
---------------------------------------
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'MyStore1' })
export class MyStore1 extends Store<MyStore1State> {
    constructor(private appConfig:AppConfig) {

        super(createInitialState(JSON.stringify(json)));
        localForage.config({
            driver: localForage.INDEXEDDB,
            name: 'Akita',
           storeName:'AppDataStore'
          });

        persistState({key:this.storeName,include:[this.storeName], storage: localForage });

    }
}

Store2:
---------------------------------------
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'MyStore2' })
export class MyStore2 extends Store<MyStore2State> {
    constructor(private appConfig:AppConfig) {

        super(createInitialState(JSON.stringify(json)));
        localForage.config({
            driver: localForage.INDEXEDDB,
            name: 'Akita',
           storeName:'AppDataStore'
          });

        persistState({key:this.storeName,include:[this.storeName], storage: localForage });

    }
}

package.json

{
"localforage": "^1.7.3",
"@datorama/akita": "^4.6.0"
}

执行任何更新操作时,无法在indexeddb中进行更新并出现以下错误

  

错误DOMException:无法在“ IDBObjectStore”上执行“ put”:   功能(根){           var _a;           返回_a = {},               _a [(/ ** @type {?} * /(keyOrRoot))] = upda ...}无法克隆。       在http://localhost:4200/vendor.js:222069:37       在createTransaction(http://localhost:4200/vendor.js:221822:9)       在http://localhost:4200/vendor.js:222053:13       在ZoneDelegate.push ../ node_modules / zone.js / dist / zone.js.ZoneDelegate.invoke   (http://localhost:4200/polyfills.js:2815:26)       在Object.onInvoke(http://localhost:4200/vendor.js:79196:33)       在ZoneDelegate.push ../ node_modules / zone.js / dist / zone.js.ZoneDelegate.invoke   (http://localhost:4200/polyfills.js:2814:32)       在Zone.push ../ node_modules / zone.js / dist / zone.js.Zone.run(http://localhost:4200/polyfills.js:2565:43)       在http://localhost:4200/polyfills.js:3299:34       在ZoneDelegate.push ../ node_modules / zone.js / dist / zone.js.ZoneDelegate.invokeTask   (http://localhost:4200/polyfills.js:2848:31)       在Object.onInvokeTask(http://localhost:4200/vendor.js:79187:33

请帮忙。

谢谢

0 个答案:

没有答案