Next.js Discord

Discord Forum

Parameter implicitly has an 'any' type.

Unanswered
Catla posted this in #help-forum
Open in Discord
CatlaOP
Hi.

    const comparisonImages = await prisma.comparison_images.findMany({
      where: {
        business_id: businessId,
      },
      orderBy: {
        created_at: 'desc',
      },
    });

    const formattedComparisonImages = comparisonImages.map((image) => ({
      id: image.id,
      title: image.title,
      beforeUrl: image.before_url,
      afterUrl: image.after_url,
      description: image.description,
      updatedAt: formatRelativeDate(image.created_at),
    }));



Please observe, that formattedComparisonImages is simply a map of comparisonImages, which has type safety from prisma. Though, when linting on vercel deployment, I receive the type error:

Failed to compile.
./lib/services/ComparisonService.ts:134:60
Type error: Parameter 'image' implicitly has an 'any' type.


Any help is appreciated... Thanks

0 Replies