Skip to content

fix: update validation return type for unknown pages router #82964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

HimanshuKumarDutt094
Copy link

I updated the return type of API routes and route handlers from

Promise | Response | Promise | void

to

Promise<Response | void> | Response | void | unknown

which fixes #82877.
for pages router with trpc the type cannot be determined

  The types returned by 'default(...)' are incompatible between these types.
    Type 'unknown' is not assignable to type 'void | Response | Promise<void | Response>'.

adding unknown fixes this and build work without any issues

@ijjk
Copy link
Member

ijjk commented Aug 23, 2025

Allow CI Workflow Run

  • approve CI run for commit: 1e2d00a

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

1 similar comment
@ijjk
Copy link
Member

ijjk commented Aug 23, 2025

Allow CI Workflow Run

  • approve CI run for commit: 1e2d00a

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@HimanshuKumarDutt094
Copy link
Author

anyone able to verify this? its working on my patch package for nextjs 15 with trpc and next auth.

@ijjk ijjk requested a review from bgub August 24, 2025 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The new validator doesn't work with rootDir tsconfig property
2 participants