Skip to content

fix: restore bundle_js template variable for Vite admin UI#4145

Open
ecthelion77 wants to merge 1 commit intoIBM:mainfrom
forterro:fix/admin-ui-bundle-js-upstream
Open

fix: restore bundle_js template variable for Vite admin UI#4145
ecthelion77 wants to merge 1 commit intoIBM:mainfrom
forterro:fix/admin-ui-bundle-js-upstream

Conversation

@ecthelion77
Copy link
Copy Markdown
Contributor

@ecthelion77 ecthelion77 commented Apr 13, 2026

🐛 Bug-fix PR

🔗 Issue

Closes #4153

📌 Summary

The admin UI fails to load the Vite-bundled JavaScript because the bundle_js template variable is missing from the template context in admin_ui(). This causes a blank admin page or JavaScript errors.

🔁 Reproduction Steps

  1. Start the gateway with the Vite-built admin UI
  2. Navigate to the admin dashboard
  3. The page loads without the main JS bundle — no interactive functionality

🐞 Root Cause

The admin_ui() handler in admin.py passes a template context dict to the Jinja2 template, but bundle_js (from get_bundle_js_filename()) was missing. The template references {{ bundle_js }} to load the correct hashed JS bundle filename, but it resolved to empty/undefined.

💡 Fix Description

Add "bundle_js": get_bundle_js_filename() to the template context dictionary in the admin_ui() handler. The get_bundle_js_filename() function already exists and resolves the Vite manifest to find the correct hashed bundle filename.

🧪 Verification

Check Command Status
Lint suite make lint
Unit tests make test
Coverage ≥ 80 % make coverage
Manual regression no longer fails Admin UI loads correctly with JS bundle

📐 MCP Compliance (if relevant)

  • Matches current MCP spec
  • No breaking change to MCP clients

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • No secrets/credentials committed

@ecthelion77
Copy link
Copy Markdown
Contributor Author

Suggested labels: bug, SHOULD, python, ui, frontend

@ecthelion77 ecthelion77 force-pushed the fix/admin-ui-bundle-js-upstream branch from 8b4600c to eb517a9 Compare April 14, 2026 12:46
@ecthelion77 ecthelion77 force-pushed the fix/admin-ui-bundle-js-upstream branch 2 times, most recently from 182b0a0 to ddbd107 Compare April 14, 2026 15:35
…esolution

Signed-off-by: Olivier Gintrand <olivier.gintrand@forterro.com>
@ecthelion77 ecthelion77 force-pushed the fix/admin-ui-bundle-js-upstream branch from ddbd107 to c2ca2e6 Compare April 14, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][UI]: Admin UI fails to load — bundle_js template variable missing from admin_ui() context

1 participant