Skip to content

DF0021: RPC Function Already Registered

Message

RPC function "{name}" is already registered

Cause

ctx.rpc.register() was called twice with the same name. RPC names must be unique within a devtool.

Fix

Either give the second registration a distinct name, or pass force: true to overwrite the previous one (e.g. during HMR-driven re-registration).

ts
ctx.rpc.register(defineRpcFunction({ name: 'my-plugin:fn', handler: () => 1 }), true /* force */)

Source

Released under the MIT License.