Skip to content
Fallow home
All docs pages

Docs home

Unused server actions

What an unused-server-action finding of fallow dead-code means, why it matters and how to fix it.

What it reports

A Next.js Server Action exported from a "use server" file is referenced by no code in the project.

Dead code explains how fallow finds it.

Why it matters

A Next.js Server Action (an export of a "use server" file) that no code in the project references: no import-and-call, no action={fn} JSX binding, no <form action={fn}>. This is the cross-graph "declared but zero consumers" direction, reclassified out of unused-export for "use server" files so the finding carries the action-specific signal. eslint-plugin-next is single-file and cannot see cross-file usage. It does not mean the endpoint is unreachable: Next.js still registers a generated action id, so it stays POST-able; it means no project code references it (likely forgotten or dead, and a candidate for removal to shrink surface area). Default warn; wire the action to a consumer or remove it. The check runs only when the project declares next.

Example

app/actions.ts has "use server" and exports submitForm, but no component imports it, binds it via action={submitForm}, or uses it in <form action={submitForm}>.

Fix

Wire the action to a consumer (an import-and-call, an action={fn} binding, or a <form action={fn}>), or remove it. If it is invoked reflectively (an action registry dispatching by id, or a non-JS caller), suppress the line with // fallow-ignore-next-line unused-server-action.

Facts

FactValue
Issue typeunused-server-action
Rule id in SARIF outputfallow/unused-server-action
Commandfallow dead-code
Default severitywarn
Config key in rulesunused-server-actions
Filter option--unused-server-actions
Suppression comment// fallow-ignore-next-line unused-server-action
Fixable with fallow fixNo
Opt-inNo