Will It Vibe logoWill It Vibe?
VUE-013Low severity-4 points

Deprecated lifecycle hook (beforeDestroy/destroyed)

Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

The beforeDestroy and destroyed lifecycle hooks were renamed to beforeUnmount and unmounted in Vue 3. The old names are ignored after a Vue 3 upgrade, so teardown logic silently stops running.

Why it matters

Vue 3 renamed the beforeDestroy and destroyed lifecycle hooks to beforeUnmount and unmounted. The old names are not recognized in Vue 3, so any cleanup you put there (clearing timers, removing listeners, closing sockets) silently never runs, which leaks resources and can cause callbacks to fire on torn-down components. The template and script still compile, so the regression is easy to miss.

How to fix it

Rename beforeDestroy to beforeUnmount and destroyed to unmounted in Options API components. In the Composition API use onBeforeUnmount and onUnmounted. Keep the hook bodies unchanged. If the project is still on Vue 2, plan this rename as part of the upgrade since the old names work there but not after.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Code Quality & Syntax checks