{"id":"2295752a117c968c","repo":"sindresorhus/got","slug":"the-searchparameters-option-does-not-exist-use","errorCode":null,"errorMessage":"The `searchParameters` option does not exist. Use `searchParams` instead.","messagePattern":"The `searchParameters` option does not exist\\. Use `searchParams` instead\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"source/core/options.ts","lineNumber":2328,"sourceCode":"\t\tif (this.#merging) {\n\t\t\t// These keys will be replaced\n\t\t\tfor (const key of updated.keys()) {\n\t\t\t\tsearchParameters.delete(key);\n\t\t\t}\n\n\t\t\tfor (const [key, value] of updated) {\n\t\t\t\tsearchParameters.append(key, value);\n\t\t\t}\n\t\t} else if (url) {\n\t\t\t// Overrides the query string in the URL.\n\t\t\turl.search = updated.toString();\n\t\t} else {\n\t\t\tthis.#internals.searchParams = updated;\n\t\t}\n\t}\n\n\tget searchParameters() {\n\t\tthrow new Error('The `searchParameters` option does not exist. Use `searchParams` instead.');\n\t}\n\n\tset searchParameters(_value: unknown) {\n\t\tthrow new Error('The `searchParameters` option does not exist. Use `searchParams` instead.');\n\t}\n\n\tget dnsLookup(): LookupFunction | undefined {\n\t\treturn this.#internals.dnsLookup;\n\t}\n\n\tset dnsLookup(value: LookupFunction | undefined) {\n\t\tassertAny('dnsLookup', [is.function, is.undefined], value);\n\n\t\tthis.#internals.dnsLookup = value;\n\t}\n\n\t/**\n\tA DNS cache instance used for making DNS lookups.","sourceCodeStart":2310,"sourceCodeEnd":2346,"githubUrl":"https://github.com/sindresorhus/got/blob/e3924aa1e53a6ca3eb93a43618ce532442a89b40/source/core/options.ts#L2310-L2346","documentation":"Getter for the misspelled `searchParameters` property that always throws. Got only supports `searchParams`; the trap getter exists to give a clear, actionable message the moment a user reads the wrong-named property instead of returning `undefined` and hiding the bug.","triggerScenarios":"Accessing `options.searchParameters` (read) on an Options instance, e.g. inside a hook doing `options.searchParameters`, or any code path that reads the misspelled key.","commonSituations":"Confusing the name with `URLSearchParams`; porting code that used a `searchParameters` key from another lib; typos.","solutions":["Read `options.searchParams` instead of `options.searchParameters`.","Search your codebase for `searchParameters` and rename all references."],"exampleFix":"// before\nconst params = options.searchParameters;\n// after\nconst params = options.searchParams;","handlingStrategy":"validation","validationCode":"function assertNoSearchParametersRead(options) {\n  if ('searchParameters' in options) {\n    throw new TypeError('Use options.searchParams, not searchParameters.');\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Grep the codebase for `searchParameters` and remove every reference.","Rely on the TypeScript types which only expose `searchParams`."],"tags":["options","search-params","typo","deprecation"],"analyzedSha":"e3924aa1e53a6ca3eb93a43618ce532442a89b40","analyzedAt":"2026-08-03T19:22:24.770Z","schemaVersion":2}