Vue · Reactivity

VUE0041Review computed() getters with no reactive dependencies

Flags computed() getters that return a literal.

Why it happens

A synchronous computed() getter that returns a literal reads no reactive source and never recomputes. Its readonly ComputedRef wrapper can still be required by exported composables, explicit types, or callers using .value.

Fix

Keep computed() when consumers require a readonly ComputedRef or .value access. Use a plain const only when no ref contract is required.

Example

Use a constant when consumers accept a plain value

Before

const heading = computed(() => 'Upcoming events')

After

const heading = 'Upcoming events'

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm vite-doctor . --framework vue --rules vue/reactivity/no-constant-computed
Copyright © 2026