GetServerSidePropsWrapper
type issues with Props and Query
#675
Labels
needs investigation
This needs to be investigated further before proceeding
Describe the problem
Wrapping a
getServerSideProps
function withgetServerSidePropsWrapper
causes erasure of the P and Q types, which means the result cannot be type-checked to match against the page component's expected Props or the paths expected Query.Additionally, if the Q type is defined, then the function cannot be handed to the wrapper as it complains about a potential disagreement between Q and
ParsedUrlQuery
.What was the expected behavior?
getServerSidePropsWrapper
should accept any P and Q types and should return precisely the same type as the handler it wraps.Reproduction
The issue is reproducible with just a few lines of TS code:
This produces two compiler errors on the final line:
On the assignment because of the Props erasure:
On the wrap because of the Query erasure:
Environment
@auth0/nextjs-auth0
version1.9.0
next
version12.1.6
4.6.2
The text was updated successfully, but these errors were encountered: