Uncaught TypeError: Cannot read properties of undefined (reading 'validateCell')

Tags: #<Tag:0x00007efc64ef6bd8>

I have used handsontable in different commponents but I want to reference sheet from one component to other even if component is unmounted.

Components:
Scenarios Grid
Snapshot Grid
Store (Contaning Hyper formula Instance)

What I have done is stored HyperFormula Instance globally in zustand.

now I filled data in Snapshot component. then changed to scenario component and referenced snapshot cell (say =‘Snapshot’!F2). this will get F2 cell of Snapshot.

When I change back to snapshot component and try to change F2 cell it will throw an Exception.

Uncaught TypeError: Cannot read properties of undefined (reading 'validateCell')

Hi @jamshaidbutt055

Do I understand correctly that you want to refer to an instance that does not exist anymore (was unmounted)?

yes HotTable instance unmounted, but HyperFormula instance is global, so I guess sheets can be referenced from even if view(HotTable) of respective sheet is destroyed.

@aleksandra_budnik, Seems like issue has been raised already
https://github.com/handsontable/handsontable/issues/8268

but fixed https://github.com/handsontable/handsontable/pull/9476

Added below code at line 734 directly in node-modules/handsontable/plugins/formulas/formulas.js

if (!hot) {
  return;
}

but still I am getting this exception?

There are also some changes below that in the PR https://github.com/handsontable/handsontable/pull/9476/files

Plus, I would recommend updating to v12.0.1 where it was fixed (we never know if something in between also changed that related to that issue).

Thank you, for now I just put condition and used patch-package to make patch of library as I am using v11.1 because v12 is having some bugs which I already posted here in forum… will test newer version later in a separate branch.

I understand.

Yes, I saw that you mentioned two issues. One of them - https://github.com/handsontable/handsontable/issues/10011 is already fixed and will be released in the new version - 12.3.0 in upcoming weeks.

1 Like

@jamshaidbutt055 we are nearly ready with the new release. Expect it soon :slight_smile:

1 Like

I think that we can already close the issue as the v12.3.0 is released.

1 Like