使用 ngxs 存储在控制台日志中看到此错误。 "Error ocurred while serializing the store value, value not updated"

Seeing this error in console log using ngxs store. "Error ocurred while serializing the store value, value not updated"

受影响的包 问题是由包@ngxs/storage-plugin/fesm5/ngxs-storage-plugin.js

引起的

描述

I am using ngxs store in my angular application for storage management. Recently I am seeing below weird console error in my browser when I switch between various angular components while dispatching action to store
'Error ocurred while serializing the store value, value not updated.'

I tried to explore on this but there is no proper documentation available over the internet on this.

异常或错误

ngxs-storage-plugin.js:288 Error ocurred while serializing the store value, value not updated.
(anonymous) @ ngxs-storage-plugin.js:288
push../node_modules/rxjs/_esm5/internal/operators/tap.js.TapSubscriber._next @ tap.js:45
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:53
push../node_modules/rxjs/_esm5/internal/ReplaySubject.js.ReplaySubject._subscribe @ ReplaySubject.js:67
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe @ Observable.js:43
push../node_modules/rxjs/_esm5/internal/Subject.js.Subject._trySubscribe @ Subject.js:89
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:29
shareReplayOperation @ shareReplay.js:42
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:24
push../node_modules/rxjs/_esm5/internal/operators/tap.js.DoOperator.call @ tap.js:18
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:24
push../node_modules/rxjs/_esm5/internal/operators/catchError.js.CatchOperator.call @ catchError.js:18
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:24
push../node_modules/rxjs/_esm5/internal/operators/tap.js.DoOperator.call @ tap.js:18
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:24
shareReplayOperation @ shareReplay.js:30
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:24
push../node_modules/@ngxs/store/fesm5/ngxs-store.js.InternalDispatcher.dispatch @ ngxs-store.js:1751
dispatch @ ngxs-store.js:2108

库:

@angular/core version: "~8.2.14",
@ngxs/devtools-plugin: "^3.7.0",
@ngxs/logger-plugin: "^3.6.2-dev.master-eaa5d86",
@ngxs/storage-plugin: "^3.7.0",
@ngxs/store: "^3.7.0",

3.6.2-dev 版本也有同样的问题。

我看了一下源码报错:https://github.com/ngxs/store/blob/2b6b81823e31f7c3d6835f4b0bec70364cb734c7/packages/storage-plugin/src/storage.plugin.ts#L62

他们留下了这张便条:

// Caretaker note: we have still left the `typeof` condition in order to avoid
// creating a breaking change for projects that still use the View Engine.

看来您需要选择加入 Ivy,或许需要退出 View Engine。这是 Ivy 的最新文档:https://angular.io/guide/ivy and if you are on version 8 of Angular: https://v8.angular.io/guide/ivy