[PR #23864] [CLOSED] fix: prevent InputVariablesModal crash (variable undefined) #50463

Closed
opened 2026-04-30 03:10:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/23864
Author: @moreveal
Created: 4/18/2026
Status: Closed

Base: devHead: fix/input-variables-crash


📝 Commits (1)

  • 11731cc fix: prevent InputVariablesModal crash (variable undefined)

📊 Changes

1 file changed (+76 additions, -73 deletions)

View changed files

📝 src/lib/components/chat/MessageInput/InputVariablesModal.svelte (+76 -73)

📄 Description

Pull Request Checklist

  • Target branch: dev
  • Description: Added below
  • Changelog: Added
  • Testing: Manually tested (modal no longer crashes, all input types work)
  • Code review: Self-reviewed
  • Git Hygiene: Single focused fix

Description

Fixes a runtime crash in InputVariablesModal.svelte when rendering input variables.

The modal could throw:

ReferenceError: variable is not defined

Root cause was unsafe iteration using Object.keys + indexing (variables[key]), which resulted in invalid compiled code and undefined access.

Replaced iteration with Object.entries and removed unsafe access pattern.


Changelog Entry

Description

  • Fix crash in Input Variables modal caused by unsafe variable iteration

Added

Changed

  • Switched from Object.keys + indexing to Object.entries iteration in InputVariablesModal.svelte
  • Simplified variable access to avoid undefined references

Deprecated

Removed

Fixed

  • Fixed ReferenceError: variable is not defined when opening Input Variables modal
  • Fixed crash when variables object is malformed or partially undefined

Security

Breaking Changes


Additional Information

  • Fix is minimal and scoped only to iteration logic
  • No changes to API or variable format
  • Prevents generation of invalid compiled Svelte code

Screenshots or Videos

  • Before: modal crashes on open
  • After: modal renders correctly and accepts input

Contributor License Agreement

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/23864 **Author:** [@moreveal](https://github.com/moreveal) **Created:** 4/18/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/input-variables-crash` --- ### 📝 Commits (1) - [`11731cc`](https://github.com/open-webui/open-webui/commit/11731cc43d94bb63a885cb6a7b5cd37e18da31c6) fix: prevent InputVariablesModal crash (variable undefined) ### 📊 Changes **1 file changed** (+76 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/MessageInput/InputVariablesModal.svelte` (+76 -73) </details> ### 📄 Description # Pull Request Checklist * [x] **Target branch:** `dev` * [x] **Description:** Added below * [x] **Changelog:** Added * [x] **Testing:** Manually tested (modal no longer crashes, all input types work) * [x] **Code review:** Self-reviewed * [x] **Git Hygiene:** Single focused fix --- ## Description Fixes a runtime crash in `InputVariablesModal.svelte` when rendering input variables. The modal could throw: ``` ReferenceError: variable is not defined ``` Root cause was unsafe iteration using `Object.keys` + indexing (`variables[key]`), which resulted in invalid compiled code and undefined access. Replaced iteration with `Object.entries` and removed unsafe access pattern. --- # Changelog Entry ### Description * Fix crash in Input Variables modal caused by unsafe variable iteration ### Added * — ### Changed * Switched from `Object.keys` + indexing to `Object.entries` iteration in `InputVariablesModal.svelte` * Simplified variable access to avoid undefined references ### Deprecated * — ### Removed * — ### Fixed * Fixed `ReferenceError: variable is not defined` when opening Input Variables modal * Fixed crash when variables object is malformed or partially undefined ### Security * — ### Breaking Changes * — --- ### Additional Information * Fix is minimal and scoped only to iteration logic * No changes to API or variable format * Prevents generation of invalid compiled Svelte code --- ### Screenshots or Videos * Before: modal crashes on open * After: modal renders correctly and accepts input --- ### Contributor License Agreement - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-30 03:10:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#50463