0

Hello Basir, i add typescript and when i try to build my site i have some error.

Type error: This expression is not callable.
  Each member of the union type '{ <ResultDoc = Document<unknown, any, { model: string; productFor: string; slug: string; imgProductPage: { productImg?: string; }[]; img: string; color: string; sizeSelection: any[]; atr: string; alt: string; price: number; ... 4 more ...; blur?: any; }> & { ...; } & { ...; }>(filter: FilterQuery<...>, projection?: ...' has signatures, but none of those signatures are compatible with each other.
   22 | export async function getServerSideProps() {
  23 |   await db.connect();
> 24 |   const products = await Product.find().lean();
     |                                  ^
  25 |   return {
  26 |     props: {
  27 |       products: products.map(db.convertDocToObj),
Hardede Asked question December 1, 2022