mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #22778] [CLOSED] fix: resolve ReferenceError in InputVariablesModal #26862
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22778
Author: @joaquinhuigomez
Created: 3/17/2026
Status: ❌ Closed
Base:
main← Head:fix/input-variables-modal-reference-error📝 Commits (1)
30e2182fix: resolve ReferenceError for idx in InputVariablesModal📊 Changes
1 file changed (+18 additions, -18 deletions)
View changed files
📝
src/lib/components/chat/MessageInput/InputVariablesModal.svelte(+18 -18)📄 Description
Summary
Fixes #22748
The
InputVariablesModalthrowsReferenceError: idx is not definedat runtime, causing the prompt variables modal to show an infinite loading spinner. The prompt variable feature is completely broken.Root cause: The
{@const}destructuring with rest syntax ({ type, ...variableAttributes }) inside an{#each}block triggers a scoping bug in Svelte 5's legacy compatibility mode, making the loop index variableidxundefined in the compiled output.Fix:
idxtovariableIdxto avoid the naming collision{@const}with an explicitObject.fromEntries(Object.entries(...).filter(...))to computevariableAttributes, sidestepping the Svelte 5 compilation issueTest plan
Hello {{name}})/in the chat input and select the custom promptvariableAttributesspread still works🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.