examples
examples copied to clipboard
[Bug] Run `pnpm run build` for frontend examples: dependencies out of date
node -v: v22.2.0
npm -v: 10.7.0
Reproduce:
- Run
pnpm run build - Error show:
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
"dependencies": {
"@bazel-example/one": "workspace:*",
"is-even": "1.0.0",
"next": "14.2.3",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@bazel/ibazel": "0.25.0",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "16.0.0",
"@types/is-even": "1.0.2",
"@types/jest": "29.5.12",
"@types/node": "20.14.2",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"eslint": "9.4.0",
"eslint-config-next": "14.2.3",
"jest-cli": "29.7.0",
"jest-junit": "16.0.0",
"jest-environment-jsdom": "29.7.0",
"jest-transform-stub": "2.0.0",
"typescript": "5.4.5"
}
}