{"id":18995533,"date":"2026-08-17T13:01:28","date_gmt":"2026-08-17T13:01:28","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=18995533"},"modified":"2026-08-17T14:12:25","modified_gmt":"2026-08-17T14:12:25","slug":"bug-report-javascript-syntaxerror-in-phlox-2-17-22-queryselector","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/bug-report-javascript-syntaxerror-in-phlox-2-17-22-queryselector\/","title":{"rendered":"Bug Report: JavaScript SyntaxError in Phlox 2.17.22 (querySelector)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi Averta Support Team,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I hope this message finds you well.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I am writing to report a JavaScript bug introduced in the latest update of the Phlox free theme (version 2.17.22). I have detected this exact same issue across 3 different websites using this theme. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After investigating, the issue comes from the <code>scripts.min.js<\/code> file. The code uses <code>document.querySelector()<\/code> on links, but fails because a selector is empty.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are the details of the environment :<\/p>\n\n\n\n<ul>\n<li><strong>Theme Name:<\/strong> Phlox (Free version)<\/li>\n<\/ul>\n\n\n\n<ul>\n<li><strong>Theme Version:<\/strong> 2.17.22<\/li>\n<\/ul>\n\n\n\n<ul>\n<li><strong>WordPress Version:<\/strong> 6.x (using jQuery 3.7.1)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Console error messages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>jquery.min.js?ver=3.7.1:2 jQuery.Deferred exception: Failed to execute 'querySelector' on 'Document': The provided selector is empty. SyntaxError: Failed to execute 'querySelector' on 'Document': The provided selector is empty.<br \/>    at https:\/\/example.com<br \/>    at Array.forEach (&lt;anonymous&gt;)<br \/>    at HTMLDocument.&lt;anonymous&gt; (https:\/\/example.com)<br \/><br \/><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>jquery.min.js?ver=3.7.1:2 Uncaught SyntaxError: Failed to execute 'querySelector' on 'Document': The provided selector is empty.<br \/>    at scripts.min.js?ver=2.17.22:1:1538<br \/>    at Array.forEach (&lt;anonymous&gt;)<br \/>    at HTMLDocument.&lt;anonymous&gt; (scripts.min.js?ver=2.17.22:1:1503)<br \/><br \/><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It seems the script loops through elements (like links) and passes an empty attribute value to <code>querySelector<\/code>, which triggers the syntax error and breaks jQuery execution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note : I temporary patched this issue on my websites by adding a check to ensure the attribute\/selector is not empty before running <code>querySelector()<\/code>. It works perfectly now.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Could you please pass this on to your development team for a quick patch?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you for your assistance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Best regards,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">carshw7<\/p>\n","protected":false},"template":"","class_list":["post-18995533","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18995533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18995533\/revisions"}],"predecessor-version":[{"id":18995584,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18995533\/revisions\/18995584"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18995533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}