Subject: Gradio Space: JavaScript not executing, fields not populating, persistent SyntaxError
in browser console
Space URL: https://huggingface.co/spaces/nikhmr1235/gradio_ui_pr_review_bot
(Please confirm this is your current problematic Space URL)
SDK: Docker
Problem Description: My Gradio application’s UI is loading, and the Hugging Face Space status shows “running,” but the JavaScript code intended to pre-fill input fields from URL query parameters is not executing. The input fields (review_id
, review_link
) remain empty.
Browser Console Errors (F12): The browser’s developer console consistently shows the following errors/warnings:
SyntaxError: Unexpected token ';'
(This is the most critical error, preventing JS execution).Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://huggingface.co') does not match the recipient window's origin ('https://nikhmr1235-gradio-ui-pr-review-bot.hf.space').
(This is a warning, but indicates embedding communication issues).GET https://nikhmr1235-pr-reviewer-gradio-ui.hf.space/manifest.json 404 (Not Found)
(Less critical, but present).
Steps Taken & Observations:
- Python Backend Status: The Hugging Face Space logs confirm the Python
app.py
starts successfully anddemo.launch()
is called, with the Space showing “running” status. No Python-level tracebacks or errors are visible in the server logs. - JavaScript Debugging:
- Added
console.log
statements within the JavaScript (both ingr.HTML
andgr.Blocks(js=...)
parameters). - None of these
DEBUG (JS):
messages appear in the browser console, indicating the JavaScript is not executing at all.
- Added
demo.launch()
Configuration: Explicitly setserver_name="0.0.0.0"
,server_port=7860
, andshare=False
.requirements.txt
: Minimal, containing onlygradio
,requests
,python-dotenv
.- Gradio Versioning: Tested with
gradio==4.38.0
and the latest version (by removing the pin). TheSyntaxError
persists with both. - Rebuilds: Multiple “Factory rebuilds” have been performed.
- New Space: Created a brand new Hugging Face Space and deployed the same code; the issue persists.
- Browser: Tested in Incognito/Private mode (Chrome).
Expected Behavior: The JavaScript should execute, read the review_id
and review_link
query parameters from the URL, and pre-fill the corresponding gr.Textbox
components in the Gradio UI.
Request: Please investigate why the JavaScript is failing to execute with a SyntaxError
in the browser console, preventing the Gradio UI from fully initializing and its embedded JavaScript from running.