{"record":{"id":"7f2600670ec550c6","repo":"Semantic-Org/Semantic-UI","slug":"jquery-serialize-object-is-required-to-add-form-da","errorCode":null,"errorMessage":"jquery-serialize-object is required to add form data to an existing data object","messagePattern":"jquery-serialize-object is required to add form data to an existing data object","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/definitions/behaviors/api.js","lineNumber":1134,"sourceCode":"\n  // server error\n  onError     : function(errorMessage, $module) {},\n\n  // request aborted\n  onAbort     : function(errorMessage, $module) {},\n\n  successTest : false,\n\n  // errors\n  error : {\n    beforeSend        : 'The before send function has aborted the request',\n    error             : 'There was an error with your request',\n    exitConditions    : 'API Request Aborted. Exit conditions met',\n    JSONParse         : 'JSON could not be parsed during error handling',\n    legacyParameters  : 'You are using legacy API success callback names',\n    method            : 'The method you called is not defined',\n    missingAction     : 'API action used but no url was defined',\n    missingSerialize  : 'jquery-serialize-object is required to add form data to an existing data object',\n    missingURL        : 'No URL specified for api event',\n    noReturnedValue   : 'The beforeSend callback must return a settings object, beforeSend ignored.',\n    noStorage         : 'Caching responses locally requires session storage',\n    parseError        : 'There was an error parsing your request',\n    requiredParameter : 'Missing a required URL parameter: ',\n    statusMessage     : 'Server gave an error: ',\n    timeout           : 'Your request timed out'\n  },\n\n  regExp  : {\n    required : /\\{\\$*[A-z0-9]+\\}/g,\n    optional : /\\{\\/\\$*[A-z0-9]+\\}/g,\n  },\n\n  className: {\n    loading : 'loading',\n    error   : 'error'\n  },","sourceCodeStart":1116,"sourceCodeEnd":1152,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/behaviors/api.js#L1116-L1152","documentation":"This error is logged by the API module's add.formData() function (api.js:425-450) when settings.serializeForm is true, there is existing data to merge (settings.data is a plain object), and the jquery-serialize-object plugin is not loaded. The module uses $.fn.serializeObject() from that plugin to convert form fields to a JSON object; without it, the module cannot merge form data into the existing settings.data and falls back to replacing it entirely.","triggerScenarios":"Configuring $('.form').api({ serializeForm: true, data: { extra: 'val' } }) without including the jquery-serialize-object script on the page. The canSerialize variable (api.js:428) checks for $.fn.serializeObject and evaluates to false when the plugin is absent.","commonSituations":"Forgetting to include jquery-serialize-object.js (a separate dependency from Semantic UI core). CDN or build pipeline dropping the serialize-object plugin. Upgrading Semantic UI and not updating the serialize-object dependency version. The plugin script failing to load due to network issues or incorrect script paths.","solutions":["Include the jquery-serialize-object plugin before Semantic UI's API module: <script src='jquery.serialize-object.js'></script>.","If you do not need to merge form data with existing data, set settings.data to a string or remove it so the form data is used directly (the else branch at api.js:446).","Alternatively, disable settings.serializeForm and serialize form data manually using $(form).serialize()."],"exampleFix":"// before\n<script src='semantic.min.js'></script>\n<script>\n$('.form').api({ serializeForm: true, data: { token: 'abc' }, url: '/submit' });\n// error: jquery-serialize-object not loaded\n</script>\n\n// after\n<script src='jquery.js'></script>\n<script src='jquery.serialize-object.js'></script>\n<script src='semantic.min.js'></script>\n<script>\n$('.form').api({ serializeForm: true, data: { token: 'abc' }, url: '/submit' });\n</script>","handlingStrategy":"validation","validationCode":"// Check for the serialize-object plugin before enabling serializeForm\nvar hasSerializeObject = $.fn.serializeObject !== undefined;\n$('.el').api({\n  serializeForm: hasSerializeObject,\n  url: '/submit'\n});\nif (!hasSerializeObject) {\n  console.warn('jquery-serialize-object not loaded; form serialization disabled.');\n}","typeGuard":"// Type guard: check if jquery-serialize-object is available\nfunction hasSerializeObjectPlugin() {\n  return typeof $.fn.serializeObject === 'function';\n}","tryCatchPattern":null,"preventionTips":["Include jquery-serialize-object.js in your build pipeline before Semantic UI.","Add a feature detection check before enabling serializeForm.","Manually serialize form data with $(form).serialize() as an alternative."],"tags":["api","serialize","form-data","missing-dependency","semantic-ui"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}