nextauthjs/next-auth · info

Response has 'error'. Redundant workaround, please open an i

Error message

Response has 'error'. Redundant workaround, please open an issue.

What it means

Twitch's token endpoint can return an OAuth error body ({ error, error_description }), and this provider's `conform` function rewrites a malformed error response into a standard one. This warn fires when the parsed error is already a string, meaning the response already conforms to the OAuth spec and the workaround is redundant. Like the sibling warning, it asks you to report it so the workaround can be dropped. It does not interrupt the OAuth flow.

Source

Thrown at packages/core/src/providers/twitch.ts:112

            console.warn(
              "'scope' is a string. Redundant workaround, please open an issue."
            )
          } else if (Array.isArray(body.scope)) {
            body.scope = body.scope.join(" ")
            return new Response(JSON.stringify(body), response)
          } else if ("scope" in body) {
            delete body.scope
            return new Response(JSON.stringify(body), response)
          }
        } else {
          const { message: error_description, error } = body
          if (typeof error !== "string") {
            return new Response(
              JSON.stringify({ error: "invalid_request", error_description }),
              response
            )
          }
          console.warn(
            "Response has 'error'. Redundant workaround, please open an issue."
          )
        }
      },
    },
    style: { bg: "#65459B", text: "#fff" },
    options: config,
  }
}

View on GitHub (pinned to a1a16a5a77)

Solutions

  1. Ignore the warning — the OAuth error is still returned and handled upstream
  2. Open an issue on the NextAuth.js/Auth.js repository noting the redundant workaround
  3. Fix the underlying OAuth failure (verify TWITCH_CLIENT_ID/SECRET, redirect URI, and that the auth code is single-use and unexpired)
Defensive patterns

Strategy: type-guard

Validate before calling

const body = await response.json()
if ("error" in body) {
  const isOAuthError = typeof body.error === "string" && typeof body.error_description === "string"
  // already spec-conformant; fix the OAuth failure instead of the warning
}

Type guard

function isOAuthErrorBody(b: any): b is { error: string; error_description?: string } {
  return b && typeof b.error === "string"
}

Prevention

When it happens

Trigger: A Twitch token request that fails (e.g. invalid code or client credentials) and returns a body whose `error` field is already a string, reaching the warn branch after the error_description handling.

Common situations: Debugging failed Twitch logins with expired authorization codes or mismatched client secret; seeing the warning alongside the actual OAuth error propagated to the sign-in callback.

Related errors


AI-assisted analysis of nextauthjs/next-auth@a1a16a5a77 (2026-08-28). Data as JSON: /api/errors/36c92a5defeb181b. Report an issue: GitHub.