{"id":"602d9857d4e2b57b","repo":"sindresorhus/got","slug":"the-followredirects-option-does-not-exist-use","errorCode":null,"errorMessage":"The `followRedirects` option does not exist. Use `followRedirect` instead.","messagePattern":"The `followRedirects` option does not exist\\. Use `followRedirect` instead\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"source/core/options.ts","lineNumber":2494,"sourceCode":"\n\tNote that if a `303` is sent by the server in response to any request type (`POST`, `DELETE`, etc.), Got will automatically request the resource pointed to in the location header via `GET`.\n\tThis is in accordance with [the spec](https://tools.ietf.org/html/rfc7231#section-6.4.4). You can optionally turn on this behavior also for other redirect codes - see `methodRewriting`.\n\tOn cross-origin redirects, Got strips `host`, `cookie`, `cookie2`, `authorization`, and `proxy-authorization`. When a redirect rewrites the request to `GET`, Got also strips request body headers. Use `hooks.beforeRedirect` for app-specific sensitive headers.\n\n\t@default true\n\t*/\n\tget followRedirect(): boolean | ((response: PlainResponse) => boolean) {\n\t\treturn this.#internals.followRedirect;\n\t}\n\n\tset followRedirect(value: boolean | ((response: PlainResponse) => boolean)) {\n\t\tassertAny('followRedirect', [is.boolean, is.function], value);\n\n\t\tthis.#internals.followRedirect = value;\n\t}\n\n\tget followRedirects() {\n\t\tthrow new TypeError('The `followRedirects` option does not exist. Use `followRedirect` instead.');\n\t}\n\n\tset followRedirects(_value: unknown) {\n\t\tthrow new TypeError('The `followRedirects` option does not exist. Use `followRedirect` instead.');\n\t}\n\n\t/**\n\tIf exceeded, the request will be aborted and a `MaxRedirectsError` will be thrown.\n\n\t@default 10\n\t*/\n\tget maxRedirects(): number {\n\t\treturn this.#internals.maxRedirects;\n\t}\n\n\tset maxRedirects(value: number) {\n\t\tassert.number(value);\n","sourceCodeStart":2476,"sourceCodeEnd":2512,"githubUrl":"https://github.com/sindresorhus/got/blob/e3924aa1e53a6ca3eb93a43618ce532442a89b40/source/core/options.ts#L2476-L2512","documentation":"Getter for the misspelled `followRedirects` property that always throws. The correct option is the singular `followRedirect`. The trap exists so reading the wrong-named option fails loudly instead of silently returning undefined (which would make redirect behavior appear to misbehave).","triggerScenarios":"Reading `options.followRedirects` anywhere, e.g. inside a hook or a custom handler that inspects redirect config.","commonSituations":"Pluralizing the option name (common since several libs use the plural form); reading config copied from elsewhere.","solutions":["Read `options.followRedirect` (singular) instead.","Grep for `followRedirects` and rename to `followRedirect`."],"exampleFix":"// before\nconst follow = options.followRedirects;\n// after\nconst follow = options.followRedirect;","handlingStrategy":"validation","validationCode":"function assertNoFollowRedirectsRead(options) {\n  if ('followRedirects' in options) {\n    throw new TypeError('Use options.followRedirect, not followRedirects.');\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Grep for `followRedirects` and rename to the singular form.","Rely on TypeScript types which only expose `followRedirect`."],"tags":["options","redirect","typo","deprecation"],"analyzedSha":"e3924aa1e53a6ca3eb93a43618ce532442a89b40","analyzedAt":"2026-08-03T19:22:24.770Z","schemaVersion":2}