Gradio Space: JavaScript not executing, fields not populating, persistent SyntaxError in browser console

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:

  1. SyntaxError: Unexpected token ';' (This is the most critical error, preventing JS execution).
  2. 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).
  3. 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 and demo.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 in gr.HTML and gr.Blocks(js=...) parameters).
    • None of these DEBUG (JS): messages appear in the browser console, indicating the JavaScript is not executing at all.
  • demo.launch() Configuration: Explicitly set server_name="0.0.0.0", server_port=7860, and share=False.
  • requirements.txt: Minimal, containing only gradio, requests, python-dotenv.
  • Gradio Versioning: Tested with gradio==4.38.0 and the latest version (by removing the pin). The SyntaxError 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.

1 Like

Seems unresolved issue…?

Thanks John! for pointing me to the known issue

1 Like