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
fix(examples): pageProps is {}
by default
#2763
Conversation
Someone is attempting to deploy a commit to the trpc Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
It's this the best way to do this or creating a props type would be more useful (as it is a scaffold, too)? |
@@ -5,7 +5,7 @@ import { trpc } from 'utils/trpc'; | |||
|
|||
const MyApp: AppType = ({ Component, pageProps }) => { | |||
return ( | |||
<SessionProvider session={pageProps.session}> | |||
<SessionProvider session={(pageProps as any).session}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to fix this without any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KATT Only if we create a type for it. But this is not intended behavior. next@12.3.1
fixes this. Do I just bump the version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we likely need to bump the version on next
and next-auth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be
const MyApp: AppType<{ session: Session | null }> = ({ Component, pageProps }) => ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try bumping the version and if it doesn't work already I will add the type. Is that ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What Julius says above is probably right -- I didn't look into why it started failing, I just noted the issue down
Closes #2754
🎯 Changes
Fixes Next type error (
pageProps
now is{}
by default).✅ Checklist
If necessary, I have added documentation related to the changes made.I have added or updated the tests related to the changes made.