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
will not allow for InferGetStaticPropsType to infer the correct type.
It also seems that including the type GetStaticPaths and GetStaticProps will force the InferGetStaticPropsType to return any as the type as seen in the thread below. #11842 (comment)
I believe the most important bug to fix in this case is that the infer for getStaticProps only works in the case where we only return props. Not in the face where we may return redirect or notFound.
Expected Behavior
My static props type should be inferred however they currently are not.
To Reproduce
Set strict mode enabled and attempt to use InferGetStaticPropsType.
The text was updated successfully, but these errors were encountered:
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 27, 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?
11.1.0
What version of Node.js are you using?
14.17.3
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
When attempting to use
InferGetStaticPropsType
I am getting my parameters' type asnever
.The following link describes my issue.
#11842 (comment)
To better explain the bug - the bug only occurs if I include the following in
getStaticProps
:It seems that including:
and:
will not allow for
InferGetStaticPropsType
to infer the correct type.It also seems that including the type
GetStaticPaths
andGetStaticProps
will force theInferGetStaticPropsType
to returnany
as the type as seen in the thread below.#11842 (comment)
I believe the most important bug to fix in this case is that the infer for
getStaticProps
only works in the case where we only returnprops
. Not in the face where we may returnredirect
ornotFound
.Expected Behavior
My static props type should be inferred however they currently are not.
To Reproduce
Set strict mode enabled and attempt to use InferGetStaticPropsType.
The text was updated successfully, but these errors were encountered: