Giter VIP home page Giter VIP logo

Comments (5)

jonaskello avatar jonaskello commented on June 18, 2024 1

I think it is related to @types/react package versions being mixed in a monorepo. In our case one package was using version 18 and importing another using 17 that had the react-konva stuff in it and that triggered this error. It would probably work if all packages in the monorepo has the exact same version of @types/react as the packages they are importing.

from react-konva.

lavrton avatar lavrton commented on June 18, 2024

Please make a very minimal repository to reproduce it. I just created a new project with vite, and the import was working just fine.

from react-konva.

jonaskello avatar jonaskello commented on June 18, 2024

Just to add one more datapoint: I have the exact same error in a larger monorepo project. Tried to reproduce it in a small repo but then the error did not appear.

from react-konva.

divmgl avatar divmgl commented on June 18, 2024

Apologies, yes, this is in a monorepo. And we ended up moving away from Konva, so I won't have time to create a minimal repro. Sorry about that.

from react-konva.

GeoMarkou avatar GeoMarkou commented on June 18, 2024

In my case I updated the package.json to target a specific version of React and React-DOM. It seems NPM was resolving the ^ to a slightly different version, which caused subtle errors like this. Leaving this here in case it helps anyone else, thank you @jonaskello for the hint.

- "react": "^18.2.0",
+ "react": "18.2.0",
- "react-dom": "^18.2.0",
+ "react-dom": "18.2.0",
- "@types/react": "^18.2.21",
+ "@types/react": "18.2.21",
- "@types/react-dom": "^18.2.7",
+ "@types/react-dom": "18.2.7",

from react-konva.

Related Issues (20)

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.