Git Product home page Git Product logo

Comments (4)

CodyJasonBennett avatar CodyJasonBennett commented on May 10, 2024 1

This would likely come from mismatched versions of react which can break context and create false positives like this. @react-three/fiber requires react and react-dom 18+, so try upgrading those with a clean install.

from its-fine.

LouisMarzorati avatar LouisMarzorati commented on May 10, 2024 1

That worked. updated package.json pasted below

  "dependencies": {
    "@react-three/drei": "^8.10.6",
    "@react-three/fiber": "^8.9.1",
    "@types/three": "^0.146.0",
    "autoprefixer": "^10.4.13",
    "next": "^13.0.7",
    "postcss": "^8.4.20",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "sass": "^1.49.8",
    "tailwindcss": "^3.2.4",
    "three": "^0.147.0"
  },

from its-fine.

kevinwgutierrez avatar kevinwgutierrez commented on May 10, 2024

2nd this

having same problem but in a Next.js app, just installed all necessary deps and libs

from its-fine.

LouisMarzorati avatar LouisMarzorati commented on May 10, 2024

3rd this

Just have a <Canvas> element rendering on a new nextjs app.

  "dependencies": {
    "@react-three/drei": "^8.10.6",
    "@react-three/fiber": "^8.9.1",
    "@types/three": "^0.146.0",
    "autoprefixer": "^10.4.13",
    "next": "12.1.0",
    "postcss": "^8.4.20",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "tailwindcss": "^3.2.4",
    "three": "^0.147.0"
  },
  
import { Canvas } from "@react-three/fiber";

export default function Home() {
  return (
    <div className="flex flex-colitems-center justify-center">
      <Canvas camera={{ position: [0, 0, 5] }}>
        <ambientLight />
        <pointLight position={[10, 10, 10]} />
        <mesh>
          <boxBufferGeometry args={[2, 2, 2]} />
          <meshStandardMaterial color="hotpink" />
        </mesh>
      </Canvas>
    </div>
  );
}

error - Error: its-fine: useFiber must be called within a !

image

from its-fine.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.