octobercms/october · error · ApplicationException

AJAX handler ':name' was not found.

Error message

AJAX handler ':name' was not found.

What it means

Thrown in execAjaxHandlers when the requested AJAX handler name is syntactically valid but no matching handler method exists on the controller, its behaviors, or bound components/widgets. It means routing succeeded but the target method is undefined at request time.

Solutions

  1. Implement the missing handler method (public, typically prefixed with on) on the controller or behavior
  2. Check for typos in the handler name used in the AJAX request
  3. If the handler lives on a component/widget, make sure that object is bound so its handlers are discovered
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/classes/Controller.php:555 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/8cf2b1a7d0a80c7a. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/classes/Controller.php:555

                 */
                if ($event = $this->fireSystemEvent('backend.ajax.beforeRunHandler', [$handler])) {
                    $response = ajax()::wrap($event);
                }
                else {
                    $response = $this->callAjaxAction($this->action, $this->params);
                }
            }
            catch (ComponentNotFound $ex) {
                throw new SystemException(Lang::get('backend::lang.widget.not_bound', ['name'=>$this->getAjaxRequest()->component]));
            }
            catch (MassAssignmentException $ex) {
                throw new SystemException(Lang::get('backend::lang.model.mass_assignment_failed', ['attribute' => $ex->getMessage()]));
            }
            catch (HandlerNameInvalid $ex) {
                throw new ApplicationException(Lang::get('backend::lang.ajax_handler.invalid_name', ['name'=>$handler]));
            }
            catch (HandlerNotFound $ex) {
                throw new ApplicationException(Lang::get('backend::lang.ajax_handler.not_found', ['name'=>e($handler)]));
            }
        }
        catch (ValidationException $ex) {
            Flash::error($ex->getMessage());
            $response = ajax()->invalidFields($ex->errors());
        }
        catch (Throwable $ex) {
            report($ex);
            $response = ajax()->exception($ex);
        }

        if ($this->hasAssetsDefined()) {
            foreach ($this->getAssetPathsWithAttributes() as $type => $paths) {
                $response->asset($type, $paths);
            }
        }

        $response = $this->outputVueComponentsForAjax($response);

View on GitHub (pinned to b608633a7e)