---
title: RELKIT_EVENT_FUNCTION_TARGET_INVALID
description: "Event function is called directly."
pagination: false
search:
  keywords: [RELKIT_EVENT_FUNCTION_TARGET_INVALID]
sidebar:
  icon: triangle-alert
---

{/* Generated by apps/docs/scripts/generate.ts. Do not edit. */}

**Event function is called directly.**

## What happened

Code calls an event-only function directly, or a route, job or tool targets it. Event functions run only when their event is published.

## What to do

Publish the event instead, or target a regular function made with `defineFunction`.

Reported by `@relkit/cli`, `relkit/diagnostics`.

See [all error codes](/docs/errors).
