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.

Uncaught TypeError: Cannot read property 'alternate' of undefined

See original GitHub issue

I’m getting this error with the example code in the readme using the latest react-konva (1.6.4), konvajs (1.7.6) and react (16.1.1) versions with typescript:

Uncaught TypeError: Cannot read property 'alternate' of undefined
    at isFiberMountedImpl (react-reconciler.development.js:130)
    at isFiberMounted (react-reconciler.development.js:158)
    at findCurrentUnmaskedContext (react-reconciler.development.js:1091)
    at getContextForSubtree (react-reconciler.development.js:6861)
    at Object.updateContainer (react-reconciler.development.js:6941)
    at Stage.componentDidMount (react-konva.js:396)
    at vendor.js?v=OjVxDpV6p_Jfz2P38F_R2lc3pjVsUisUejeIABZq7AE:29697
    at measureLifeCyclePerf (vendor.js?v=OjVxDpV6p_Jfz2P38F_R2lc3pjVsUisUejeIABZq7AE:29508)
    at vendor.js?v=OjVxDpV6p_Jfz2P38F_R2lc3pjVsUisUejeIABZq7AE:29696
    at CallbackQueue.notifyAll (vendor.js?v=OjVxDpV6p_Jfz2P38F_R2lc3pjVsUisUejeIABZq7AE:18480)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
lavrtoncommented, Mar 25, 2021

You need to match react and react-konva versions. react-konva depends on some react internals, so matching versions are important. If versions are not matching you must see a peerDependency warning in the terminal when you install react-konva with npm (probably yarn shows that warning too).

The best way to solve the issue, is to install the lastest versions of react, react-dom and react-konva.

npm install react@latest react-dom@latest react-konva@latest

If you don’t want to upgrade react, you can use the lower version of react-konva.

npm install react-konva@16
0reactions
souldjlcommented, Apr 25, 2022

same error here, trying the basic example from the readme. i dont know how to reslove it “react”: “^16.13.0”, “react-dom”: “^17.0.2”, “react-konva”: “^16.8.6”, “konva”: “^8.3.5”,

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError : Cannot read properties of undefined
Looking for ways to handle Uncaught TypeError: Cannot read property of undefined in JavaScript? This guide will help you to catch errors.
Read more >
reactjs - TypeError: Cannot read properties of undefined ...
Your error in the console shows products.name (plural) but the code you've shared is product (singular). Which one is correct? – Matt U....
Read more >
How to Read React Errors (fix 'Cannot read property of ...
Let's break this down! Cannot read property means the code was trying to read a property.
Read more >
Dojos.js:9 Uncaught TypeError: Cannot read properties of ...
Dojos.js:9 Uncaught TypeError: Cannot read properties of undefined (reading 'characters') What am I doing wrong?
Read more >
Uncaught TypeError: Cannot read property of undefined
Out of the six primitive types defined in JavaScript, namely boolean, string, symbol, number, Null, and undefined, no other type throws as ...
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