{"record":{"id":"b5b30eece4e2660d","repo":"octobercms/october","slug":"the-request-handler-name-is-not-specified","errorCode":null,"errorMessage":"The request handler name is not specified.","messagePattern":"The request handler name is not specified\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"modules/system/assets/js/framework.js","lineNumber":324,"sourceCode":"          }\n        }\n      }\n      return out;\n    }\n    getRedirectUrl() {\n      const op = this.getOps(\"redirect\")[0];\n      return op?.url || this.redirect || null;\n    }\n    getReload() {\n      return this.getOps(\"reload\")[0] || null;\n    }\n  };\n\n  // ../../vendor/larajax/larajax/resources/src/request/options.js\n  var Options = class {\n    constructor(handler, options) {\n      if (!handler) {\n        throw new Error(\"The request handler name is not specified.\");\n      }\n      if (!handler.match(/^(?:\\w+\\:{2})?on*/)) {\n        throw new Error('Invalid handler name. The correct handler name format is: \"onEvent\".');\n      }\n      if (typeof FormData === \"undefined\") {\n        throw new Error(\"The browser does not support the FormData interface.\");\n      }\n      this.options = options;\n      this.handler = handler;\n    }\n    static fetch(handler, options) {\n      return new this(handler, options).getRequestOptions();\n    }\n    // Public\n    getRequestOptions() {\n      return {\n        method: \"POST\",\n        url: this.options.url ? this.options.url : window.location.href,","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/assets/js/framework.js#L306-L342","documentation":"Thrown by the Options constructor (request/options.js) in October CMS's AJAX framework. Every AJAX request must name a server-side handler; Options is constructed for each oc.request()/oc.ajax() call, and a falsy handler (empty string, null, undefined) aborts immediately with this message.","triggerScenarios":"oc.ajax('', {update: {...}}) with an empty handler; oc.request(el) where el is not inside a [data-request] element and no handler argument is given (getHandlerName() finds no data-request attribute); dynamically passing a handler variable that is undefined at call time.","commonSituations":"Calling oc.request(element) without arguments on an element missing data-request; refactoring code so the handler variable is undefined; copy-pasted markup missing the data-request attribute; forms relying on a parent's data-request where the element is outside that subtree.","solutions":["Pass the handler explicitly: oc.request(el, 'onSubmit', options)","Or add the attribute: <form data-request=\"onSubmit\"> so getHandlerName() can find it","If the handler comes from a variable, default it: oc.request(el, handler || 'onSubmit')","Ensure the element is actually inside the [data-request] subtree when relying on inheritance"],"exampleFix":"// before\noc.request(form);\n\n// after\noc.request(form, 'onSubmit');\n// or in markup: <form data-request=\"onSubmit\" ...>","handlingStrategy":"validation","validationCode":"function requestTargetReady(el, handler) {\n  const h = handler || el?.closest('[data-request]')?.getAttribute('data-request');\n  return Boolean(h);\n}\n\nif (requestTargetReady(form, handler)) oc.request(form, handler);","typeGuard":"const hasHandler = (el) => !!(el && (el.dataset.request || el.closest('[data-request]')));","tryCatchPattern":"try { oc.request(el, handler); } catch (e) { if (/handler name is not specified/.test(e.message)) { console.error('Add data-request or pass an on* handler'); return; } throw e; }","preventionTips":["Always pass the handler explicitly when the element may lack data-request","Default handler variables: oc.request(el, handler || 'onSubmit')","Assert the element sits inside a [data-request] subtree before relying on inheritance"],"tags":["ajax","handler","validation","frontend"],"backgroundTag":"missing-ajax-handler","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}