jspreadsheet / ce

Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.
https://bossanova.uk/jspreadsheet/v4
MIT License
6.66k stars 818 forks source link

Intermittent error in cross-sheet calculations #1665

Closed JohnPatrickOshaughnessy closed 6 months ago

JohnPatrickOshaughnessy commented 6 months ago

So I have four sheets in memory, all data loaded from the server with jspreadsheet.calculations(false); once all loaded I run jspreadsheet.calculations(true);.

This works for most formulas nearly all the time however I have '#ERROR' appearing in a cell with a cross sheet calculation formula about 75% of the time, the remaining 25% it works fine. With debugFormulas:true I see the following in my JS console when the error occurs:

image

Other cross sheet calculations work reliably, including those that target the result of a complex formula.

It seems to be complaining about a ':' character, I can see that the target cell in the target sheet is having its value reported as "SUM(B4:B9)" - Now this is obviously an invalid formula as it's missing the '='. However if I look at the value of the cell directly I see:

image

This would indicate that the formula in the target cell is OK, confirmed by the fact that the value displayed in B10 is indeed the expected SUM result. I'm only guessing this is the cause of the error but having spent a couple of days debugging I am running out of ideas. My feeling is that the error only happens when the target cell contains a range within a formula (like "=SUM(A1:A10)") but what's strange is that sometimes it works ok.

JohnPatrickOshaughnessy commented 6 months ago

Here's the full stack trace in case it helps:

image

JohnPatrickOshaughnessy commented 6 months ago

Sorry posted this in the wrong place. Have reposted in https://github.com/jspreadsheet/pro/issues/304

hodeware commented 6 months ago

Hi John, Which version are you using? Can you contact support@jspreadsheet.com please? We would be happy to assist you.

JohnPatrickOshaughnessy commented 6 months ago

It's V10, will send an email