Error with asynchronous operation in TypeScript schema validation using Effect library
Hi guys. I was writing this schema for user profiles:
The important thing of it is the filter for the
But it breaks everthing, and the error in the editor only says:
Honestly I don't get it, it marks the whole callback inside
The important thing of it is the filter for the
Username, the idea is to check that the username is not in use. So I use coll.findOne to search an user profile with that username (the database implementation is using mongodb). coll.findOne is an asynchronous operation, it needs await. Long story short, I tried to use this where the commented line:But it breaks everthing, and the error in the editor only says:
Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.ts(7024)Honestly I don't get it, it marks the whole callback inside
Schema.filterEffect with that error.