Several pages use raw
tags for user avatars, causing LCP warnings in the build output.
These should be replaced with Next.js
for automatic optimisation.
Affected files:
src/app/contributors/page.tsx — lines 153, 177, 201, 276
src/app/u/[username]/page.tsx — line 266
src/components/layout/Navbar.tsx — user avatar img
How to fix:
// Before
<img src={user.avatarUrl} alt={user.name} className="w-8 h-8 rounded-full" />
// After
import Image from "next/image";
<Image src={user.avatarUrl} alt={user.name} width={32} height={32} className="rounded-full" />
next.config.js already has remotePatterns: [{ protocol: 'https', hostname: '**' }] so all external image URLs are already allowed.
Acceptance criteria:
All <img> tags for user avatars replaced with <Image>
No new @next/next/no-img-element warnings in the build output
Avatars still render correctly at all sizes
Several pages use raw
tags for user avatars, causing LCP warnings in the build output.
for automatic optimisation.
These should be replaced with Next.js
Affected files:
src/app/contributors/page.tsx— lines 153, 177, 201, 276src/app/u/[username]/page.tsx— line 266src/components/layout/Navbar.tsx— user avatar imgHow to fix: