next.js/pages/index.tsx(13,8): error TS2786: 'Head' cannot be used as a JSX component.
Its type '({ children }: { children: React.ReactNode; }) => Element' is not a valid JSX element type.
Type '({ children }: { children: React.ReactNode; }) => Element' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'Element' is not assignable to type 'ReactNode'.
Property 'children' is missing in type 'Element' but required in type 'ReactPortal'.
next.js/pages/index.tsx(72,14): error TS2786: 'Image' cannot be used as a JSX component.
Its type '({ src, sizes, unoptimized, priority, loading, className, quality, width, height, fill, style, onLoad, onLoadingComplete, placeholder, blurDataURL, layout, objectFit, objectPosition, lazyBoundary, lazyRoot, ...all }: ImageProps) => Element' is not a valid JSX element type.
Type '({ src, sizes, unoptimized, priority, loading, className, quality, width, height, fill, style, onLoad, onLoadingComplete, placeholder, blurDataURL, layout, objectFit, objectPosition, lazyBoundary, lazyRoot, ...all }: ImageProps) => Element' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'Element' is not assignable to type 'ReactNode'.
Fix: Update dependencies in next.js/package.json to the latest version
node -v
: v22.2.0npm -v
: 10.7.0 Reproduce:pnpm run build
Fix: Update dependencies in
next.js/package.json
to the latest version