{"record":{"id":"f2b47e317b33c2c0","repo":"appsmithorg/appsmith","slug":"resetwidget-expected-string-for-widgetname-argum","errorCode":null,"errorMessage":"resetWidget expected STRING for 'widgetName' argument but received ${received}","messagePattern":"resetWidget expected STRING for 'widgetName' argument but received (.+?)","errorType":"validation","errorClass":"ActionValidationError","httpStatus":null,"severity":"error","filePath":"app/client/src/sagas/ActionExecution/ResetWidgetActionSaga.ts","lineNumber":24,"sourceCode":"  ActionValidationError,\n  TriggerFailureError,\n} from \"sagas/ActionExecution/errorUtils\";\nimport { getType, Types } from \"utils/TypeHelpers\";\nimport type { FlattenedWidgetProps } from \"WidgetProvider/types\";\nimport { ReduxActionTypes } from \"ee/constants/ReduxActionConstants\";\nimport type { TResetWidgetDescription } from \"workers/Evaluation/fns/resetWidget\";\nimport AppsmithConsole from \"utils/AppsmithConsole\";\nimport type { SourceEntity } from \"entities/AppsmithConsole\";\n\nexport default function* resetWidgetActionSaga(\n  action: TResetWidgetDescription,\n  source?: SourceEntity,\n) {\n  const { payload } = action;\n  const { metaUpdates, resetChildren, widgetName } = payload;\n\n  if (getType(widgetName) !== Types.STRING) {\n    throw new ActionValidationError(\n      \"RESET_WIDGET_META_RECURSIVE_BY_NAME\",\n      \"widgetName\",\n      Types.STRING,\n      getType(widgetName),\n    );\n  }\n\n  const widget: FlattenedWidgetProps | undefined = yield select(\n    getWidgetByName,\n    widgetName,\n  );\n\n  if (!widget) {\n    throw new TriggerFailureError(`Widget ${payload.widgetName} not found`);\n  }\n\n  yield put(resetWidgetMetaUpdates(metaUpdates));\n","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/client/src/sagas/ActionExecution/ResetWidgetActionSaga.ts#L6-L42","documentation":"ActionValidationError thrown by resetWidgetActionSaga when the widgetName argument is not a string. The error message is built from the TRIGGER_ACTION_VALIDATION_ERROR template and surfaces the expected vs received type, so the user can see exactly what resetWidget rejected. This is a synchronous argument-type check before the saga ever touches the widget tree.","triggerScenarios":"Calling resetWidget() with a number, object, array, undefined, or null as widgetName; binding widgetName to a query result or store value that resolves to a non-string; passing a widget reference object instead of its name.","commonSituations":"Binding {{ Table1.selectedRow }} (object) into widgetName; passing an undefined variable because the source row was cleared; copy-paste left a placeholder like {{ }} in the field.","solutions":["Pass the literal widget name string, e.g. resetWidget('Input1').","If the value comes from a binding, coerce or guard it: resetWidget(String(name)).","Verify in the JS object that the resolved value is a string before calling resetWidget."],"exampleFix":"// before\nresetWidget(Table1.selectedRow); // object\n// after\nresetWidget('Input1');           // string literal","handlingStrategy":"type-guard","validationCode":"if (typeof widgetName !== 'string' || !widgetName.trim()) {\n  showAlert('resetWidget needs a widget name string', 'error');\n  return;\n}\nresetWidget(widgetName);","typeGuard":"function isWidgetName(v: unknown): v is string {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  resetWidget(name);\n} catch (e) {\n  if (e instanceof ActionValidationError) showAlert(e.message, 'error');\n}","preventionTips":["Pass widget names as string literals where possible.","Never bind an object (selectedRow, query response) directly to widgetName.","Coerce with String(...) only after confirming the value is meaningful."],"tags":["reset-widget","validation","typescript","argument-type"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}