Skip to main content
HTML Validation

Bad value X for attribute “src” on element “script”: Illegal character in query. “{” is not allowed.

About This HTML Issue

A { in the query string of a <script> element's src is not a valid URL character, and it almost always comes from a template placeholder that was never replaced.

Curly braces can appear in a URL only when they're percent-encoded as %7B and %7D. In a script URL they usually belong to a cache-busting parameter such as ?v=${build.version} or ?v={{version}}. The template engine or the build step should have swapped the placeholder for a version number or a timestamp, but the raw text reached the page instead. A misspelled variable name, or a template file the build step doesn't process, leaves it behind.

Browsers still load the script, sending the placeholder text as part of the query. The cache buster stops doing its job, though: the URL stays the same after every deploy, so browsers and CDNs can keep serving an old copy of the file.

Fix the template or the build configuration so the placeholder renders as a real value. If the braces are meant to be literal, percent-encode them.

Invalid example

<script src="/js/app.js?v=${build.version}"></script>

Valid example

<script src="/js/app.js?v=2.4.1"></script>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries