nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
25.04k stars 3.54k forks source link

fix(nextjs): Update params type with Promise as expected in Next.js 15 #12114

Closed ggallon closed 3 weeks ago

ggallon commented 1 month ago

โ˜•๏ธ Reasoning

Follow #12002, fix type error with auth() wapprer, update params type with Promise in handler. Ref: Next.js Doc

๐Ÿงข Checklist

๐ŸŽซ Affected issues

๐Ÿ“Œ Resources

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

Name Status Preview Comments Updated (UTC)
auth-docs โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Oct 31, 2024 10:27pm
1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **next-auth-docs** | โฌœ๏ธ Ignored ([Inspect](https://vercel.com/authjs/next-auth-docs/4VEQKS5ab6FsEo8uWd6Tn4w1JgVj)) | [Visit Preview](https://next-auth-docs-git-fork-ggallon-fix-nextjs15-prom-e7bb3d-authjs.vercel.app) | | Oct 31, 2024 10:27pm |
vercel[bot] commented 1 month ago

@ggallon is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 39.21%. Comparing base (ad9ed04) to head (87af2a5). Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
packages/next-auth/src/lib/types.ts 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #12114 +/- ## ========================================== - Coverage 39.22% 39.21% -0.01% ========================================== Files 191 191 Lines 29928 29929 +1 Branches 1291 1297 +6 ========================================== Hits 11738 11738 - Misses 18190 18191 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ggallon commented 1 month ago

@balazsorban44, It's done

github-actions[bot] commented 1 month ago

Broken Link Checker

0 broken links found. Links organised below by source page, or page where they were found.

ggallon commented 1 month ago

@balazsorban44 sorry, that's not the way. pnpm tsc --noEmit in locale not always cause an error (??) but every time with pnpm next build:

Type "AppRouteHandlerFnContext" is not a valid type for the function's second argument.
    Expected "Promise<any>", got "Awaitable<Record<string, string | string[]>> | undefined".
      Expected "Promise<any>", got "undefined".
Aralf commented 4 weeks ago

@balazsorban44 sorry, that's not the way. pnpm tsc --noEmit in locale not always cause an error (??) but every time with pnpm next build:

Type "AppRouteHandlerFnContext" is not a valid type for the function's second argument.
    Expected "Promise<any>", got "Awaitable<Record<string, string | string[]>> | undefined".
      Expected "Promise<any>", got "undefined".

@ggallon as the error mentions, undefined is not valid, that's because params is set as optional, it shouldn't be.

rpavlovs commented 1 week ago

@balazsorban44 could you please bump the npm package version?

rpavlovs commented 6 days ago

@balazsorban44 Please make an npm push. This is blocking Next 15, React 19 update.