{"record":{"id":"9822e689f3ae2459","repo":"windmill-labs/windmill","slug":"invalid-empty-file-extension-make-sure-it-is-sele","errorCode":null,"errorMessage":"Invalid empty file extension (make sure it is selected)","messagePattern":"Invalid empty file extension \\(make sure it is selected\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/routes/(root)/(logged)/resources/+page.svelte","lineNumber":328,"sourceCode":"\t\t\t\t\t...x\n\t\t\t\t}\n\t\t\t}\n\t\t)\n\t\tloading.types = false\n\t}\n\n\tasync function deleteResource(path: string, account?: number): Promise<void> {\n\t\tif (account) {\n\t\t\tOauthService.disconnectAccount({ workspace: $workspaceStore!, id: account })\n\t\t}\n\t\tawait ResourceService.deleteResource({ workspace: $workspaceStore!, path })\n\t\treload()\n\t}\n\n\tasync function addResourceType(): Promise<void> {\n\t\tif (!newResourceType.isFileset) {\n\t\t\tif (newResourceType.formatExtension === '') {\n\t\t\t\tthrow new Error('Invalid empty file extension (make sure it is selected)')\n\t\t\t}\n\t\t\tif (!validateFileExtension(newResourceType.formatExtension ?? 'txt')) {\n\t\t\t\tthrow new Error('Invalid file extension')\n\t\t\t}\n\t\t}\n\t\tawait ResourceService.createResourceType({\n\t\t\tworkspace: $workspaceStore!,\n\t\t\trequestBody: {\n\t\t\t\tname: (disableCustomPrefix ? '' : 'c_') + newResourceType.name,\n\t\t\t\tschema: newResourceType.schema,\n\t\t\t\tdescription: newResourceType.description,\n\t\t\t\tformat_extension: newResourceType.formatExtension,\n\t\t\t\tis_fileset: newResourceType.isFileset\n\t\t\t}\n\t\t})\n\t\tresourceTypeDrawer?.closeDrawer?.()\n\t\tsendUserToast('Resource type created')\n\t\tloadResourceTypes()","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/routes/(root)/(logged)/resources/+page.svelte#L310-L346","documentation":"The resources page's addResourceType validates the new resource-type form before calling ResourceService.createResourceType. For a non-fileset type, an empty formatExtension is rejected with this error because the backend would create a file resource type with no extension.","triggerScenarios":"Submitting the 'add resource type' form with 'is fileset' unchecked while the file-format extension dropdown/input was left empty (''), e.g. user chose format 'Custom' but never picked an extension.","commonSituations":"Forgetting to select the file extension in the create-resource-type drawer; a form state reset that cleared the extension while isFileset stayed false; pasting a config where extension is empty string instead of undefined.","solutions":["Select a file extension in the resource-type form before submitting","Tick the 'fileset' option instead if the type has no single extension","Ensure the form initializes formatExtension to a sensible default (e.g. 'txt') when not a fileset"],"exampleFix":"// before\nformatExtension: '',\nisFileset: false\n// after\nformatExtension: 'txt', // or select a value in the dropdown\nisFileset: false","handlingStrategy":"validation","validationCode":"if (!newResourceType.isFileset && (newResourceType.formatExtension ?? '') === '') {\n  sendUserToast('Select a file extension for this resource type', true)\n  return\n}\nawait addResourceType()","typeGuard":"function hasExtension(rt: { isFileset: boolean; formatExtension?: string }): boolean {\n  return rt.isFileset || (typeof rt.formatExtension === 'string' && rt.formatExtension.length > 0)\n}","tryCatchPattern":"try {\n  await addResourceType()\n} catch (e) {\n  if (e.message.includes('Invalid empty file extension')) {\n    sendUserToast('Pick a file extension in the form', true)\n  } else throw e\n}","preventionTips":["Default formatExtension to a common value (e.g. 'txt') in form state","Disable the submit button until required fields pass client validation","Prefer a <select> of known extensions over free-text input","Show inline field errors instead of throwing from the submit handler"],"tags":["validation","frontend","forms"],"backgroundTag":"invalid-file-extension","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}