by serving your application your application should break (assuming you added correctly the module to the vuex store.
In particular, thanks to the chrome debugger I found out where is the problem:
// If prototype field is an explicit mutation
var fieldIsExplicitMutation = (typeof descriptor.value === "function" &&
explicitMutationNames.indexOf(field) > -1); // BREAKS HERE
if (fieldIsExplicitMutation) {
var mutation = function (state, payload) { return descriptor.value.call(state, payload); };
explicitMutations[field] = mutation;
return "continue";
}
Workaround
Just add a dummy mutation
class MyComponent extends {
// ...
@mutation dummy() : void {
throw new Error("Should never call this method, it is a workaround");
}
}
Actual Fix
note that if explicitMutations is an empty object explicitMutationNames is undefined, therefore, adding an additional check would make this error disappear. I would revise how the explicitMutationNames array is created anyway.
Hello, thanks for the work you are doing. I am writing to signal an easily fixable bug of the component.
How to reproduce
Create a vuex class component with no mutations, in my particular case the component had the following code:
by serving your application your application should break (assuming you added correctly the module to the vuex store.
In particular, thanks to the chrome debugger I found out where is the problem:
Workaround
Just add a dummy mutation
Actual Fix
note that if
explicitMutations
is an empty objectexplicitMutationNames
isundefined
, therefore, adding an additional check would make this error disappear. I would revise how theexplicitMutationNames
array is created anyway.Thank you :+1: