Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Run pnpm run build for frontend examples: dependencies out of date #465

Open
dkthezero opened this issue Jun 7, 2024 · 0 comments

Comments

@dkthezero
Copy link

dkthezero commented Jun 7, 2024

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"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant