Skip to content

fix(desktop): crash on dialog open — undefined.trim()#737

Open
vanducng wants to merge 2 commits intomainfrom
hotfix/desktop-form-dialogs-crash
Open

fix(desktop): crash on dialog open — undefined.trim()#737
vanducng wants to merge 2 commits intomainfrom
hotfix/desktop-form-dialogs-crash

Conversation

@vanducng
Copy link
Copy Markdown
Contributor

@vanducng vanducng commented Apr 7, 2026

Summary

  • Desktop form dialogs (MCP, Agent, Team Settings) crash with undefined is not an object (evaluating 'l("name").trim') when opened
  • Root cause: useForm() called without defaultValueswatch() returns undefined on first render before useEffect fires reset()
  • Fix: add defaultValues to useForm() in all 3 affected dialogs

Files Changed

  • ui/desktop/frontend/src/components/mcp/McpFormDialog.tsx
  • ui/desktop/frontend/src/components/agents/AgentFormDialog.tsx
  • ui/desktop/frontend/src/components/teams/TeamSettingsModal.tsx

Closes #732, closes #735

Test Plan

  • Open desktop app → Settings → MCP → Add MCP Server → form renders without crash
  • Open desktop app → Agents → "+" button → form renders without crash
  • Open desktop app → Teams → settings on any team → modal renders without crash
  • Fill and submit all 3 forms — verify data saves correctly

… open

McpFormDialog, AgentFormDialog, and TeamSettingsModal used useForm()
without defaultValues, relying on reset() in useEffect. On first render
when dialog opens, watch() returns undefined — calling .trim() on it
crashes with "undefined is not an object".

Closes #732, closes #735
@vanducng vanducng force-pushed the hotfix/desktop-form-dialogs-crash branch from 0a7310c to 1d94821 Compare April 7, 2026 09:29
…Dialog

Same root cause as the previous commit — useForm() without defaultValues
causes watch() to return undefined on first render.
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.

1 participant