championswimmer / vuex-module-decorators

TypeScript/ES7 Decorators to create Vuex modules declaratively
https://championswimmer.in/vuex-module-decorators/
MIT License
1.8k stars 170 forks source link

got error when use @Mutation in app.config.errorHandler #371

Open LitStronger opened 3 years ago

LitStronger commented 3 years ago

runtime-core.esm-bundler.js:408 Uncaught (in promise) Error: Maximum recursive updates exceeded. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function. at checkRecursiveUpdates (runtime-core.esm-bundler.js:408) at flushJobs

the code in main.ts

app.config.errorHandler = (err, vm, info) => {
  console.log(err, vm, info);
  errorStore.commitCount(1);
};

in store.ts

import { VuexModule, getModule, Module, Mutation } from "vuex-module-decorators";
  @Mutation
  commitCount(extra: any) {
    this.count += extra;
}

who can tell me why?

LitStronger commented 3 years ago

image

cuebit commented 3 years ago

This is unrelated to vuex-module-decorators.