Describe the bug
Blocks.launch(js=...) accepts a JavaScript function string and serializes it into the app config (GET /config returns it under the js key), but the 6.x frontend never evaluates it — the function silently does not run.
The same function string passed to demo.load(js=...) executes normally, so the string itself is valid; only the launch(js=...) channel is dead. Since the parameter is still accepted and documented, apps migrating from Gradio 4/5 lose their page-setup scripts silently — no error, no warning.
Expected: either the config js is executed on page load (as in Gradio 4/5), or launch(js=...)/Blocks(js=...) raises a deprecation error pointing at a working channel.
Have you searched existing issues? 🔎
Reproduction
import gradio as gr
with gr.Blocks() as demo:
gr.Markdown("launch(js=) repro")
demo.launch(js="() => { document.title = 'LAUNCH-JS-RAN'; }")
-
curl http://127.0.0.1:7860/config | jq .js → "() => { document.title = 'LAUNCH-JS-RAN'; }" — the config carries the function.
-
Open the app; wait for full load. document.title remains "Gradio". The function never runs (verified with Playwright; no console errors).
-
Control: change the last line to
demo.load(None, None, None, js="() => { document.title = 'LAUNCH-JS-RAN'; }")
demo.launch()
and the title changes — the identical string executes via the load event.
Screenshot
Not applicable.
Logs
No console errors — the config value is simply never evaluated.
System Info
Gradio version: 6.20.0
gradio_client version: 2.5.0
Python: 3.12.7
OS: macOS 26.3.1 (arm64)
Browser: Chromium (Playwright) and Chrome
Severity
I can work around it (moved the script to demo.load(js=...)), but the silent failure cost real debugging time and will bite anyone migrating 4/5-era apps.
\n\n## Before / after Spaces\n\n- Before fix\n- After fix — draft PR #13642
Before / after Spaces
Describe the bug
Blocks.launch(js=...)accepts a JavaScript function string and serializes it into the app config (GET /configreturns it under thejskey), but the 6.x frontend never evaluates it — the function silently does not run.The same function string passed to
demo.load(js=...)executes normally, so the string itself is valid; only thelaunch(js=...)channel is dead. Since the parameter is still accepted and documented, apps migrating from Gradio 4/5 lose their page-setup scripts silently — no error, no warning.Expected: either the config
jsis executed on page load (as in Gradio 4/5), orlaunch(js=...)/Blocks(js=...)raises a deprecation error pointing at a working channel.Have you searched existing issues? 🔎
Reproduction
curl http://127.0.0.1:7860/config | jq .js→"() => { document.title = 'LAUNCH-JS-RAN'; }"— the config carries the function.Open the app; wait for full load.
document.titleremains"Gradio". The function never runs (verified with Playwright; no console errors).Control: change the last line to
and the title changes — the identical string executes via the
loadevent.Screenshot
Not applicable.
Logs
System Info
Severity
I can work around it (moved the script to
demo.load(js=...)), but the silent failure cost real debugging time and will bite anyone migrating 4/5-era apps.\n\n## Before / after Spaces\n\n- Before fix\n- After fix — draft PR #13642
Before / after Spaces