mongodb-labs / full-stack-fastapi-mongodb

Full stack, modern web application generator. Using FastAPI, MongoDB as database, Docker, automatic HTTPS and more.
MIT License
510 stars 86 forks source link

running example Error: Type error: This kind of expression is always truthy. #55

Closed shouari closed 1 month ago

shouari commented 1 month ago

hello while running the exmaple (docker compose build) I'm constanatly facing this error Type error: This kind of expression is always truthy. Can anyone help with this?

Screenshot for ref. image

shouari commented 1 month ago

Issue was solved by changing from this code: `switch (condition) { case "required": return

This field is required.
; case "minLength" || "maxLength": return (

Your password must be between 8 and 64 characters long.
    );

}`

to this: `switch (condition) { case "required": return

This field is required.
; case "minLength": case "maxLength": return (

Your password must be between 8 and 64 characters long.
    );

}` in the indicated files. There are 3 or 4 to be corrected

Cajuteq commented 1 month ago

For people who have that in the codebase and are asking themself what happened, it was a hidden bug that was revealed by Typescript 5.6 update. Here is the PR https://github.com/microsoft/TypeScript/pull/59217