{"record":{"id":"3d33f4ea7b3bc3f5","repo":"nodejs/node","slug":"und-err-not-supported","errorCode":"UND_ERR_NOT_SUPPORTED","errorMessage":"Not supported error","messagePattern":"Not supported error","errorType":"exception","errorClass":"NotSupportedError","httpStatus":null,"severity":"warning","filePath":"deps/undici/src/lib/api/readable.js","lineNumber":227,"sourceCode":"  /**\n   * Consumes and returns the body as an ArrayBuffer.\n   *\n   * @see https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n   * @returns {Promise<ArrayBuffer>}\n   */\n  arrayBuffer () {\n    return consume(this, 'arrayBuffer')\n  }\n\n  /**\n   * Not implemented\n   *\n   * @see https://fetch.spec.whatwg.org/#dom-body-formdata\n   * @throws {NotSupportedError}\n   */\n  async formData () {\n    // TODO: Implement.\n    throw new NotSupportedError()\n  }\n\n  /**\n   * Returns true if the body is not null and the body has been consumed.\n   * Otherwise, returns false.\n   *\n   * @see https://fetch.spec.whatwg.org/#dom-body-bodyused\n   * @readonly\n   * @returns {boolean}\n   */\n  get bodyUsed () {\n    return util.isDisturbed(this)\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#dom-body-body\n   * @readonly\n   * @returns {ReadableStream}","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/undici/src/lib/api/readable.js#L209-L245","documentation":"Thrown as NotSupportedError (code UND_ERR_NOT_SUPPORTED) by the fetch Body/Response .formData() method in undici's readable.js. Parsing multipart/form-data and application/x-www-form-urlencoded bodies into FormData is intentionally not implemented (the source marks it TODO). Calling .formData() on any Response always throws, regardless of the Content-Type.","triggerScenarios":"Calling const form = await response.formData() on an undici fetch Response, even when the body is multipart/form-data. This is a hard unimplemented stub, not a runtime/content condition.","commonSituations":"Porting browser fetch code that uses response.formData() to Node/undici; handling file upload responses; parsing webhook payloads that are form-encoded.","solutions":["Parse the body manually: for multipart use a parser like busboy/formdata-node/undici's own multipart utility; for urlencoded use new URLSearchParams(await res.text()).","If you control the server, have it return JSON instead of form-encoded bodies.","Upgrade undici — check release notes; if formData support landed, update to that version. Until then treat formData() as unavailable."],"exampleFix":"// before\nconst form = await response.formData()\n\n// after (urlencoded)\nconst params = new URLSearchParams(await response.text())\nconst value = params.get('field')\n\n// or (multipart) use a dedicated parser such as formdata-node/busboy","handlingStrategy":"fallback","validationCode":"async function readFormData(response) {\n  const ct = response.headers.get('content-type') || ''\n  const text = await response.text()\n  if (ct.includes('application/x-www-form-urlencoded')) {\n    return new URLSearchParams(text)\n  }\n  // multipart: delegate to busboy/formdata-node\n  throw new Error('multipart formData parsing not supported by undici; use busboy')\n}","typeGuard":"function isFormDataSupported() { return false } // undici formData() is unimplemented","tryCatchPattern":"try {\n  const form = await response.formData()\n} catch (e) {\n  if (e.code === 'UND_ERR_NOT_SUPPORTED') {\n    // fall back to manual URLSearchParams or a multipart parser\n  } else throw e\n}","preventionTips":["Never call response.formData() on undici — it is a known unimplemented stub.","Parse urlencoded bodies with new URLSearchParams(await res.text()).","Parse multipart with busboy/formdata-node, or have the server emit JSON.","Watch undici release notes for native formData() support."],"tags":["undici","fetch","formdata","not-supported","body"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}