Skip to content

Add explicit Promise return type to getUser for proper type inference#13

Merged
DTTconnect merged 1 commit into
mainfrom
claude/fix-typescript-client-types-01SP3Pyb7owuGMygXVPJnQ24
Nov 15, 2025
Merged

Add explicit Promise return type to getUser for proper type inference#13
DTTconnect merged 1 commit into
mainfrom
claude/fix-typescript-client-types-01SP3Pyb7owuGMygXVPJnQ24

Conversation

@DTTconnect
Copy link
Copy Markdown
Owner

Fix TypeScript's inability to infer types through nested destructuring by adding explicit Promise return type annotation to the mock getUser() method.

Changes:

  • Import User and AuthError types from @supabase/supabase-js
  • Add explicit Promise<{ data: { user: User | null }; error: AuthError | null }> return type
  • Remove 'as any' cast from user field since explicit typing is now provided

This gives TypeScript complete type information for the entire promise chain, resolving the 'Binding element user implicitly has an any type' error.

Fix TypeScript's inability to infer types through nested destructuring by
adding explicit Promise return type annotation to the mock getUser() method.

Changes:
- Import User and AuthError types from @supabase/supabase-js
- Add explicit Promise<{ data: { user: User | null }; error: AuthError | null }> return type
- Remove 'as any' cast from user field since explicit typing is now provided

This gives TypeScript complete type information for the entire promise chain,
resolving the 'Binding element user implicitly has an any type' error.
@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
dtc Error Error Nov 15, 2025 3:14am

@DTTconnect DTTconnect merged commit a7a84ba into main Nov 15, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants