diff --git a/src/utils/decorators.ts b/src/utils/decorators.ts index 181543fc1..e54252abc 100644 --- a/src/utils/decorators.ts +++ b/src/utils/decorators.ts @@ -56,6 +56,10 @@ export function createClassPropertyDecorator( } return newDescriptor; } else { + if (typeof descriptor.get === "function") { + throw new Error("[mobx] action is not expected to be used with getters"); + } + // babel and typescript getter / setter props if (!hasOwnProperty(target, "__mobxLazyInitializers")) { addHiddenProp(target, "__mobxLazyInitializers",