{"id":2845,"date":"2025-08-01T00:37:03","date_gmt":"2025-08-01T04:37:03","guid":{"rendered":"https:\/\/csimmons.dev\/blog\/?p=2845"},"modified":"2025-08-01T00:52:23","modified_gmt":"2025-08-01T04:52:23","slug":"coldfusion-2021-update-20-does-not-support-_-as-an-argument-error-with-ajax-autocomplete-for-jquery","status":"publish","type":"post","link":"https:\/\/csimmons.dev\/blog\/2025\/08\/coldfusion-2021-update-20-does-not-support-_-as-an-argument-error-with-ajax-autocomplete-for-jquery\/","title":{"rendered":"ColdFusion 2021 Update 20 &#8211; &#8220;does not support _ as an argument&#8221; error with Ajax Autocomplete for jQuery"},"content":{"rendered":"<p>ColdFusion (2021 release) Update 20 recently broke multiple autosuggest fields across my organization&#8217;s web applications. ColdFusion (2023 release) Update 14 causes the same issue.<\/p>\n<p>Many of our organization&#8217;s autosuggest fields utilize <a href=\"http:\/\/www.devbridge.com\/projects\/autocomplete\/jquery\/\" target=\"_blank\" rel=\"noopener\">Ajax Autocomplete for jQuery<\/a>. This jQuery plugin retrieves data from a ColdFusion cfc to populate a field as a user enters data.<\/p>\n<p>The frustrating thing for the end user is that the autosuggest fields simply stopped working so there was no error for them to report.<\/p>\n<p>The first step used to troubleshoot the issue was to head over to our Dev environment and fire up Chrome&#8217;s Developer Tools and try to use an autosuggest field. The result was a <em>Failed to load resource<\/em> error in the <strong>Console<\/strong> tab.<\/p>\n<figure id=\"attachment_2849\" aria-describedby=\"caption-attachment-2849\" style=\"width: 593px\" class=\"wp-caption alignnone\"><img width=\"603\" height=\"44\" data-public-id=\"devtools-error\/devtools-error.png\" loading=\"lazy\" decoding=\"async\" class=\"wp-post-2845 wp-image-2849 size-full\" src=\"https:\/\/res.cloudinary.com\/ccsimmons\/images\/w_603,h_44,c_scale\/f_auto,q_auto\/v1754023205\/devtools-error\/devtools-error.png?_i=AA\" alt=\"Failed to load resource: the server responded with a status of 500 (Internal Server Error)\" data-format=\"png\" data-transformations=\"f_auto,q_auto\" data-version=\"1754023205\" data-seo=\"1\" srcset=\"https:\/\/res.cloudinary.com\/ccsimmons\/images\/f_auto,q_auto\/v1754023205\/devtools-error\/devtools-error.png?_i=AA 603w, https:\/\/res.cloudinary.com\/ccsimmons\/images\/w_300,h_22,c_scale\/f_auto,q_auto\/v1754023205\/devtools-error\/devtools-error.png?_i=AA 300w\" sizes=\"auto, (max-width: 603px) 100vw, 603px\" \/><figcaption id=\"caption-attachment-2849\" class=\"wp-caption-text\">Failed to load resource: the server responded with a status of 500 (Internal Server Error)<\/figcaption><\/figure>\n<p>The next step was to move to the <strong>Network<\/strong> tab, locate the url of the call to the cfc, right click and choose &#8220;Open in new tab&#8221;. The following error was the result.<\/p>\n<figure id=\"attachment_2847\" aria-describedby=\"caption-attachment-2847\" style=\"width: 765px\" class=\"wp-caption alignnone\"><img width=\"775\" height=\"495\" data-public-id=\"cf-error\/cf-error.png\" loading=\"lazy\" decoding=\"async\" class=\"wp-post-2845 wp-image-2847 size-full\" src=\"https:\/\/res.cloudinary.com\/ccsimmons\/images\/w_775,h_495,c_scale\/f_auto,q_auto\/v1754023064\/cf-error\/cf-error.png?_i=AA\" alt=\"ColdFusion error: does not support _ as an argument\" data-format=\"png\" data-transformations=\"f_auto,q_auto\" data-version=\"1754023064\" data-seo=\"1\" srcset=\"https:\/\/res.cloudinary.com\/ccsimmons\/images\/f_auto,q_auto\/v1754023064\/cf-error\/cf-error.png?_i=AA 775w, https:\/\/res.cloudinary.com\/ccsimmons\/images\/w_300,h_192,c_scale\/f_auto,q_auto\/v1754023064\/cf-error\/cf-error.png?_i=AA 300w, https:\/\/res.cloudinary.com\/ccsimmons\/images\/w_768,h_491,c_scale\/f_auto,q_auto\/v1754023064\/cf-error\/cf-error.png?_i=AA 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><figcaption id=\"caption-attachment-2847\" class=\"wp-caption-text\">ColdFusion error: does not support _ as an argument<\/figcaption><\/figure>\n<p>I saw a nearly identical error message post Update 20 where there was a mismatch in the number of arguments passed to a method in an older cfc in one of our web applications. In that instance, instead of <code>_<\/code> the argument being passed was the actual name of a field which was no longer an argument in the method of the cfc so I knew there was an argument mismatch, but what the heck was this <code>_<\/code> argument?<\/p>\n<p>The <code>_<\/code> argument is appended to the URL by jQuery if you use <code>$.ajaxSetup({ cache: false });<\/code>. It is a jQuery global configuration that disables caching for all subsequent AJAX GET requests made via jQuery by appending a unique query parameter (like <code>_={timestamp}<\/code>) to each request URL.<\/p>\n<pre>\n    https:\/\/demos.local\/cfcs\/room.cfc?method=getRoomAutoComplete&query=Lab&_=1753998286050\n<\/pre>\n<p><strong>There are 2 ways to fix this issue in ColdFusion or 2 ways to fix it via JavaScript.<\/strong><\/p>\n<h2>ColdFusion Solution 1 &#8211; Fix the argument mismatch<\/h2>\n<p>Update the method used by autosuggest, in our case <strong>getRoomAutoComplete()<\/strong>, to include an argument named <code>_<\/code>:<\/p>\n<pre>    remote any function getRoomAutoComplete(required string query, string _) returnformat=\"plain\" {\n        ...\n    }\n<\/pre>\n<h2>ColdFusion Solution 2 A- Override the new feature (ColdFusion Administrator)<\/h2>\n<p>In the ColdFusion Administrator search for &#8220;Java &amp; JVM&#8221; (or in jvm.config) add:<\/p>\n<pre>\n    -Dcoldfusion.runtime.remotemethod.matchArguments=false and restart CF services.\n<\/pre>\n<h2>ColdFusion Solution 2 B &#8211; Override the new feature (CommandBox)<\/h2>\n<p>If you&#8217;re using CommandBox add the following to your <code>server.json<\/code> file:<\/p>\n<pre>\n    \"jvm\":{\n        \"args\":[\n        \"-Dcoldfusion.runtime.remotemethod.matchArguments=false\"\n        ]\n    }\n<\/pre>\n<h2>JavaScript Solution 1 &#8211; Avoid disabling caching globally in JavaScript<\/h2>\n<p>Avoid using the following to disable caching globally in your JavaScript:<\/p>\n<pre>\n    $.ajaxSetup({ cache: false });\n<\/pre>\n<h2>JavaScript Solution 2 &#8211; Override caching globally in JavaScript<\/h2>\n<p>If you must disable caching globally in your JavaScript, you can override it for Autocomplete using the following:<\/p>\n<pre>\n    ajaxSettings: {\n        cache: true\n    }\n<\/pre>\n<h2>Read more<\/h2>\n<p><a href=\"https:\/\/helpx.adobe.com\/coldfusion\/using\/new-jvm-arguments-2023-2021-coldfusion-updates.html\" target=\"_blank\" rel=\"noopener\">JVM arguments in 2023 and 2021 updates of ColdFusion<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ColdFusion (2021 release) Update 20 recently broke multiple autosuggest fields across my organization&#8217;s web applications. ColdFusion (2023 release) Update 14 causes the same issue. Many of our organization&#8217;s autosuggest fields utilize Ajax Autocomplete for jQuery. This jQuery plugin retrieves data from a ColdFusion cfc to populate a field as a user enters data. The frustrating &#8230; <a title=\"ColdFusion 2021 Update 20 &#8211; &#8220;does not support _ as an argument&#8221; error with Ajax Autocomplete for jQuery\" class=\"read-more\" href=\"https:\/\/csimmons.dev\/blog\/2025\/08\/coldfusion-2021-update-20-does-not-support-_-as-an-argument-error-with-ajax-autocomplete-for-jquery\/\" aria-label=\"Read more about ColdFusion 2021 Update 20 &#8211; &#8220;does not support _ as an argument&#8221; error with Ajax Autocomplete for jQuery\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_cloudinary_featured_overwrite":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[68],"tags":[48],"class_list":["post-2845","post","type-post","status-publish","format-standard","hentry","category-developer","tag-coldfusion"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pbVg43-JT","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/2845","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/comments?post=2845"}],"version-history":[{"count":0,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/2845\/revisions"}],"wp:attachment":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/media?parent=2845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/categories?post=2845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/tags?post=2845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}