Comments (5)
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.
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.
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.
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.
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)
- A way of applying filters on entire layer/stage/canvas? HOT 2
- Support rotateAnchorCursor HOT 1
- Best way to draw a handle HOT 1
- Advice for `cache` usage w.r.t memory leak HOT 1
- Same `Module not found: Can't resolve 'canvas'` in nextjs 13.5.5 HOT 1
- Poor performance in production build HOT 6
- [feature request] Function components image add padding HOT 1
- export 'useId' (imported as 'React') was not found in 'react' HOT 3
- How to achieve a layered separation between children of the same group? HOT 9
- Uncaught TypeError: getImage.crop is not a function
- Shapes with opacity do not correctly apply layer pixelRatio and can appear blurry on zoom in HOT 4
- NextJS: Module not found: Can't resolve 'canvas' HOT 2
- Issue with RTL Text
- Facing the issue now with Next.js 14: HOT 5
- OnTouchStart does not contain touches HOT 1
- getRelativePointerPosition has an offset on x when going fullscreen
- Asynchronous drawing will exceed the cropping area HOT 4
- Free drawing performance HOT 6
- Transformer is not reusable HOT 2
- Coordinates not working correctly after zoom in/out or drag of stage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-konva.