{"record":{"id":"e32fad4e4695a65c","repo":"microsoft/playwright","slug":"expected-string-for-options-form-name-found","errorCode":null,"errorMessage":"Expected string for options.form[\"${name}\"], found File. Please use options.multipart instead.","messagePattern":"Expected string for options\\.form\\[\"(.+?)\"\\], found File\\. Please use options\\.multipart instead\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/client/fetch.ts","lineNumber":219,"sourceCode":"      if (options.data !== undefined) {\n        if (isString(options.data)) {\n          if (isJsonContentType(headers))\n            jsonData = isJsonParsable(options.data) ? options.data : JSON.stringify(options.data);\n          else\n            postDataBuffer = Buffer.from(options.data, 'utf8');\n        } else if (Buffer.isBuffer(options.data)) {\n          postDataBuffer = options.data;\n        } else if (typeof options.data === 'object' || typeof options.data === 'number' || typeof options.data === 'boolean') {\n          jsonData = JSON.stringify(options.data);\n        } else {\n          throw new Error(`Unexpected 'data' type`);\n        }\n      } else if (options.form) {\n        if (globalThis.FormData && options.form instanceof FormData) {\n          formData = [];\n          for (const [name, value] of options.form.entries()) {\n            if (typeof value !== 'string')\n              throw new Error(`Expected string for options.form[\"${name}\"], found File. Please use options.multipart instead.`);\n            formData.push({ name, value });\n          }\n        } else {\n          formData = objectToArray(options.form);\n        }\n      } else if (options.multipart) {\n        multipartData = [];\n        if (globalThis.FormData && options.multipart instanceof FormData) {\n          const form = options.multipart;\n          for (const [name, value] of form.entries()) {\n            if (isString(value)) {\n              multipartData.push({ name, value });\n            } else {\n              const file: ServerFilePayload = {\n                name: value.name,\n                mimeType: value.type,\n                buffer: Buffer.from(await value.arrayBuffer()),\n              };","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/client/fetch.ts#L201-L237","documentation":"Error \"Expected string for options.form[\"${name}\"], found File. Please use options.multipart instead.\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/playwright-core/src/client/fetch.ts:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}