Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

marlalain
Copy link

Closes #2754

🎯 Changes

Fixes Next type error (pageProps now is {} by default).

✅ Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

@vercel
Copy link

vercel bot commented Sep 20, 2022

Someone is attempting to deploy a commit to the trpc Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Sep 20, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
www ✅ Ready (Inspect) Visit Preview Sep 20, 2022 at 6:51AM (UTC)

@marlalain
Copy link
Author

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}>
Copy link
Member

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

Copy link
Author

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?

Copy link
Member

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

Copy link
Member

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 }) => ...

Copy link
Author

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?

Copy link
Member

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

@KATT KATT closed this Sep 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(example): websockets example has type error
3 participants