Skip to content

Argument of type 'string' is not assignable to parameter of type 'RedirectType | undefined' #88627

@typeofweb

Description

@typeofweb

Link to the code that reproduces this issue

https://github.com/typeofweb/redirect-next-reproduction

To Reproduce

  1. Open the codebase
  2. Look at /app/page.tsx

Current vs. Expected behavior

Currenty behavior

app/page.tsx:4:28 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'RedirectType | undefined'.

4  return redirect("/admin", RedirectType.replace);
                             ~~~~~~~~~~~~~~~~~~~~


Found 1 error in app/page.tsx:4

Expected behavior

No errors.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.3.0: Fri Dec  5 23:12:37 PST 2025; root:xnu-12377.80.260.0.1~42/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 14
Binaries:
  Node: 22.17.1
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.26.0
Relevant Packages:
  next: 16.1.1-canary.29 // Latest available version is detected (16.1.1-canary.29).
  eslint-config-next: N/A
  react: 19.3.0-canary-bb8a76c6-20260115
  react-dom: 19.3.0-canary-bb8a76c6-20260115
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

TypeScript

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed)

Additional context

This works fine in canary-27 and is broken in canary-28.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions