Premium support for our pure JavaScript UI components


Post by vasyl obukh »

Hello,
Could you please help me with an issue I encountered when upgrading packages to the latest version?
For context, I am updating from 5.6.11 to 6.2.3.
We use a chained task store in Gantt (due to multiple reasons on how we display data in Gantt, and 3 partnered components - SchedulerPro, ResourceHistogram, and ResourceUtilization). Since we updated to the most recent version, task copy & paste started throwing errors when copying a task tree (copying one task still works, though).

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'id')
    at gantt.module.js?485648:365:2739285
    at Array.forEach (<anonymous>)
    at f.<anonymous> (gantt.module.js?485648:365:2739219)
    at f.traverse (gantt.module.js?485648:310:326544)
    at f.traverse (gantt.module.js?485648:310:326630)
    at gantt.module.js?485648:365:2739093
    at Array.forEach (<anonymous>)
    at TaskCopyPaste.extractAssignments (gantt.module.js?485648:365:2738980)
    at TaskCopyPaste.extractParents (gantt.module.js?485648:365:2736738)
    at TaskCopyPaste.cloneData (gantt.module.js?485648:338:168721)

If the task store is not chained, it works fine, but we need it to be chained to display everything as we need.
You can reproduce this issue by using this example https://bryntum.com/products/gantt/examples/advanced/ and following the steps from the attached video.
Here's also code snippet used in the video in the devtools:

gantt.store = gantt.store.chain();
Attachments
Screen Recording 2025-06-09 at 4.28.55 PM.mov
(17.93 MiB) Downloaded 2 times

Post by ghulam.ghous »

Hey,

The reason is same as explained here: viewtopic.php?p=169559#p169559


Post by vasyl obukh »

Hi,
With "chainTree", it did stop throwing errors, but now, when I listen to the project's "hasChanges" event, no events are emitted when I paste the task tree.
To reproduce it, use this example https://bryntum.com/products/gantt/examples/advanced/ and follow the steps from the attached video.

Here are the commands used in the video:

gantt.store.clear();
gantt.store.applyChangeset({
    added: [
    { id: "123", name: "Task 1", startDate: "2025-10-01", endDate: "2025-10-02" },
    { id: "234", name: "Task 2", startDate: "2025-10-01", endDate: "2025-10-02", parentId: "123" },
    { id: "345", name: "Task 3", startDate: "2025-10-01", endDate: "2025-10-02" },
    ],
});
gantt.project.acceptChanges();
gantt.store = gantt.store.chainTree();
gantt.project.on('hasChanges', () => console.log(gantt.project.changes));
Attachments
Screen Recording 2025-06-10 at 12.04.02 PM.mov
(10.47 MiB) Downloaded 5 times

Post by ghulam.ghous »

Thanks for the detailed report, opened a ticket here to fix it: https://github.com/bryntum/support/issues/11477


Post Reply