{"record":{"id":"7ebdff1c63980dc6","repo":"reflex-dev/reflex","slug":"cannot-set-update-interval-without-caching","errorCode":null,"errorMessage":"Cannot set update interval without caching.","messagePattern":"Cannot set update interval without caching\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/reflex-base/src/reflex_base/vars/base.py","lineNumber":2980,"sourceCode":"        initial_value: The initial value of the computed var.\n        cache: Whether to cache the computed value.\n        deps: Explicit var dependencies to track.\n        auto_deps: Whether var dependencies should be auto-determined.\n        interval: Interval at which the computed var should be updated.\n        backend: Whether the computed var is a backend var.\n        **kwargs: additional attributes to set on the instance\n\n    Returns:\n        A ComputedVar instance.\n\n    Raises:\n        ValueError: If caching is disabled and an update interval is set.\n        VarDependencyError: If user supplies dependencies without caching.\n        ComputedVarSignatureError: If the getter function has more than one argument.\n    \"\"\"\n    if cache is False and interval is not None:\n        msg = \"Cannot set update interval without caching.\"\n        raise ValueError(msg)\n\n    if cache is False and (deps is not None or auto_deps is False):\n        msg = \"Cannot track dependencies without caching.\"\n        raise VarDependencyError(msg)\n\n    if fget is not None:\n        sign = inspect.signature(fget)\n        if len(sign.parameters) != 1:\n            raise ComputedVarSignatureError(fget.__name__, signature=str(sign))\n\n        if inspect.iscoroutinefunction(fget):\n            computed_var_cls = AsyncComputedVar\n        else:\n            computed_var_cls = ComputedVar\n        return computed_var_cls(\n            fget,\n            initial_value=initial_value,\n            cache=cache,","sourceCodeStart":2962,"sourceCodeEnd":2998,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-base/src/reflex_base/vars/base.py#L2962-L2998","documentation":"Raised when a ComputedVar is declared with cache=False but an update interval is supplied. Caching must be enabled for rx.memo/cache=True before interval-based refresh makes sense, so reflex rejects the combination at decoration time.","triggerScenarios":"@rx.memo(cache=False, interval=5) or rx.computed(var_name, cache=False, interval=...) — any computed var decorator/signature where cache is explicitly False and interval is not None.","commonSituations":"Developer disables caching to always recompute, then also tries to add interval throttling; or copies a cached-var example but flips cache to False.","solutions":["Remove the interval argument, or","Set cache=True (the default) and keep the interval, e.g. @rx.memo(interval=5)"],"exampleFix":"# before\n@rx.memo(cache=False, interval=5)\ndef total(self) -> int: ...\n# after\n@rx.memo(interval=5)\ndef total(self) -> int: ...","handlingStrategy":"validation","validationCode":"import inspect\nsig = inspect.signature(rx.memo)\nparams = {k: v.default for k, v in sig.parameters.items()}\n# in tests: assert not (kwargs.get('cache') is False and kwargs.get('interval') is not None)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never combine cache=False with interval or deps","Run a lint/test asserting decorator kwargs are mutually compatible"],"tags":["reflex","computed-var","cache","decorator"],"backgroundTag":"invalid-decorator-arguments","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}