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

Add troubleshooting section to README #12

Open
akheron opened this issue Mar 24, 2020 · 0 comments
Open

Add troubleshooting section to README #12

akheron opened this issue Mar 24, 2020 · 0 comments

Comments

@akheron
Copy link
Owner

akheron commented Mar 24, 2020

Type errors

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant