Nuxt · Lifecycle

NUXT0068Use VueUse timer composables

Finds VueUse project code that should use the supported use timers pattern instead.

Why it happens

Effects that outlive their component create leaks and stale updates. Register cleanup where Vue or VueUse can dispose it automatically.

Fix

Use the VueUse-supported use timers pattern instead.

Example

Use VueUse timers

Before

<script setup lang="ts">
const timer = setInterval(tick, 1000)
onBeforeUnmount(() => clearInterval(timer))
</script>

After

<script setup lang="ts">
useIntervalFn(tick, 1000)
</script>

Verify the fix

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

pnpm nuxt doctor --rules vueuse/prefer-use-timers
Copyright © 2026