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
Type errors like these are hard to decipher, add explanation:
// index.ts:24:7 - error TS2322: Type 'Route<ExpressContext, Response<400, string, undefined> | Response<200, string, undefined>>' is not assignable to type 'Route<ExpressContext, Response<400, string, undefined> | Response<200, "OK", undefined>>'.
// Type 'Response<400, string, undefined> | Response<200, string, undefined>' is not assignable to type 'Response<400, string, undefined> | Response<200, "OK", undefined>'.
// Type 'Response<200, string, undefined>' is not assignable to type 'Response<400, string, undefined> | Response<200, "OK", undefined>'.
// Type 'Response<200, string, undefined>' is not assignable to type 'Response<400, string, undefined>'.
// Type '200' is not assignable to type '400'.
The real problem usually is that the type of body doesn't match with the annotated response types.
Express compatibility
In express, res.send(200) writes OK and sets Content-Type: text/plain; charset=utf-8. Typera doesn't.
The text was updated successfully, but these errors were encountered:
Type errors
Type errors like these are hard to decipher, add explanation:
The real problem usually is that the type of body doesn't match with the annotated response types.
Express compatibility
In express,
res.send(200)
writesOK
and setsContent-Type: text/plain; charset=utf-8
. Typera doesn't.The text was updated successfully, but these errors were encountered: