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

8.16.5 has breaking types changes #3270

Closed
yaroslavnikiforov opened this issue May 22, 2024 · 3 comments · Fixed by #3276
Closed

8.16.5 has breaking types changes #3270

yaroslavnikiforov opened this issue May 22, 2024 · 3 comments · Fixed by #3276
Labels
bug Something isn't working Typescript issues to do with TS

Comments

@yaroslavnikiforov
Copy link

yaroslavnikiforov commented May 22, 2024

Originally titled: "Property 'div' does not exist on type 'JSX.IntrinsicElements'."

Version 8.16.5 has breaking changes and brings a batch of TS errors like:
Property 'div' does not exist on type 'JSX.IntrinsicElements'.

Type '{ dpr: number; camera: { fov: number; near: number; far: number; zoom: number; }; gl: { antialias: false; powerPreference: string; }; frameloop: Frameloop; }' is not assignable to type 'Props & RefAttributes<HTMLCanvasElement>'.

Property 'children' is missing in type '{ dpr: number; camera: { fov: number; near: number; far: number; zoom: number; }; gl: { antialias: false; powerPreference: string; }; frameloop: Frameloop; }' but required in type 'CanvasProps'.

"three": "0.164.1",
"@react-three/fiber": "8.16.6",
"react": "18.0.0",
"react-dom": "18.0.0",

"@types/react": "18.0.18",
"@types/react-dom": "18.0.6",
"@types/three": "0.164.0",

How to deal with that?

@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented May 22, 2024

I need to see a reproduction or relevant TypeScript configuration to know where to place this issue.

Related: #3256 #3258.

@CodyJasonBennett CodyJasonBennett added bug Something isn't working Typescript issues to do with TS labels May 23, 2024
@CodyJasonBennett CodyJasonBennett changed the title Property 'div' does not exist on type 'JSX.IntrinsicElements'. 8.16.5 has breaking types changes May 23, 2024
@jdpnielsen
Copy link

I can replicate this on v8.16.6 in my nextjs project with the following tsconfig:

{
  "compilerOptions": {
    "baseUrl": ".",
    "target": "ES2017",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "incremental": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "plugins": [
      {
        "name": "next"
      }
    ],
    "strictNullChecks": true
  },
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx",
    ".next/types/**/*.ts",
    "postcss.config.js",
    "next.config.mjs"
  ],
  "exclude": [
    "node_modules"
  ]
}

Setting "jsx": "react-jsx", did not help.

Downgrading to v8.16.4 resolves the typing issue.

@synchronos-t
Copy link

Installing @types/react version 18.2.6 or newer seems to solve this for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Typescript issues to do with TS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants