question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'autoDrawEnabled' of undefined

See original GitHub issue

Firstly 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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
OliverBrace1commented, Nov 17, 2021

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 is var _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.

0reactions
lavrtoncommented, Apr 27, 2022

Should be fixed with the last konva version. If not, please make a repo to reproduce.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found