You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All code related to typing getStaticPaths and getStaticProps currently enforce having async functions or using the individual types over the convenient GetStaticProps/GetStaticPaths types.
However, it's a perfectly valid use case to use getStaticProps and/or getStaticPaths without loading something from external sources, which wouldn't require an async function.
## Bug
- [x] fixes#24684
- [x] Integration tests added
Intentionally omitted changing the types for `GetServerSideProps` etc. as its imo less reasonable to leverage SSR with a sync `getServerSideProps`. Can of course change the type too if you consider that also a valid case.
flybayer
pushed a commit
to blitz-js/next.js
that referenced
this issue
Jun 16, 2021
…l#24685)
## Bug
- [x] fixesvercel#24684
- [x] Integration tests added
Intentionally omitted changing the types for `GetServerSideProps` etc. as its imo less reasonable to leverage SSR with a sync `getServerSideProps`. Can of course change the type too if you consider that also a valid case.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 28, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Next.js are you using?
10.2.0
What version of Node.js are you using?
16
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
unrelated
Describe the Bug
All code related to typing
getStaticPaths
andgetStaticProps
currently enforce havingasync
functions or using the individual types over the convenientGetStaticProps
/GetStaticPaths
types.https://github.com/vercel/next.js/blob/0af3b52640/packages/next/types/index.d.ts#L110
https://github.com/vercel/next.js/blob/0af3b52640/packages/next/types/index.d.ts#L116
https://github.com/vercel/next.js/blob/0af3b52640/packages/next/types/index.d.ts#L132
However, it's a perfectly valid use case to use
getStaticProps
and/orgetStaticPaths
without loading something from external sources, which wouldn't require an async function.This is of course really just a nitpick.
Expected Behavior
Neither should error, since these work:
To Reproduce
The text was updated successfully, but these errors were encountered: