TypeError: Cannot read property 'autoDrawEnabled' of undefined
See original GitHub issueFirstly I find overall this package to be brilliant.
Secondly:
I am having an issue when using this package with jest.
When trying to run a small example with any test using jest I get:
TypeError: Cannot read property 'autoDrawEnabled' of undefined
autoDrawEnabled
is coming from konva and console.log revales that konva.autoDrawEnabled
is indeed defined.
I have tried
import Konva from "konva";
and /* global Konva */
to no avail.
(based off https://gitter.im/konvajs/konva/archives/2019/08/07)
It seems to be getting upset within the makeUpdates.js
file.
For now I can make the issue go away by replacing:
!_Global.Konva.autoDrawEnabled
in makeUpdates.js
with just !true
Which gets my code running.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Cannot read property 'apply' of undefined Konva.js
I'm trying to find object by using method find . It is only a part of code, just to demonstrate issue. In general...
Read more >Issues · konvajs/react-konva - GitHub
componentDidCatch TypeError: Cannot read properties of undefined (reading 'isBatchingLegacy'). #695 opened on Jun 28 by BouncyKnight-LQ.
Read more >react-konva - Bountysource
ReactKonvaHostConfig.js:67 Uncaught TypeError: Cannot read property 'prototype' of ... Type 'Text | undefined' is not assignable to type 'Node<NodeConfig>'.
Read more >Can Not Read Properties of Undefined Reading Map in React ...
If you are looking at can not read properties of undefined reading map in react js error or map function is not displaying...
Read more >Cannot read property of undefined api handling - YouTube
Fix: TypeError : Cannot read property of undefined react | Cannot read property of undefined api ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So I think I’ve found the exact issue. In
makeUpdates.js
the line!_Global.Konva.autoDrawEnabled
should acutally be!_Global.autoDrawEnabled
And that’s it, it seems. That seems to make everything work.
_Global
isvar _Global = require('konva/lib/Global');
The property is not stored in_Global.Konva
because their is no_Global.Konva
. There is, however!_Global.autoDrawEnabled
which I assume is what is trying to be called.Should be fixed with the last konva version. If not, please make a repo to reproduce.