Gantt within a Lightning web component does not load

Hi, we have implemented gantt in a Lightning web component in our salesforce org. In Salesforce, there is a feature of Lightning Web Security which can be enabled in the org by a checkbox, whenever we enable this feature the component with gantt does not load and it gives a generic error as belows

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘error’)
at Object.apply (aura_prod.js:55:88749)
at aura_prod.js:55:65046
at tn.hybridGetTrap [as get] (eval at Ty (aura_prod.js:55:71352), :3:19975)
at e (eval at (eval at Ty (aura_prod.js:55:71352)), :35:167357)
at Object.eval [as method] (eval at (eval at Ty (aura_prod.js:55:71352)), :35:167592)
at Object.getState (eval at (eval at Ty (aura_prod.js:55:71352)), :35:77879)
at c._render_tasks_scales (eval at (eval at Ty (aura_prod.js:55:71352)), :11:52216)
at c.refresh (eval at (eval at Ty (aura_prod.js:55:71352)), :11:57090)
at c.setSize (eval at (eval at Ty (aura_prod.js:55:71352)), :11:47608)
at e.setContentSize (eval at (eval at Ty (aura_prod.js:55:71352)), :11:255682)

For now, we have disabled the checkbox but that is not suggested by Salesforce and it has to be enabled for security purpose.

Can someone provide some insights if possible?
Thank you

Hello Rohit,
That issue can occur in older Gantt versions as there, the lightbox is added to the document.body element, and Salesforce doesn’t allow that. But it was fixed in the 7.1.13 version:
https://docs.dhtmlx.com/gantt/whatsnew.html#7113

The official demo still has the 7.1.11 version, but it will be updated in the future:

Here is an example of how it works in the 8.0.2 version:


If your Gantt version is 7.1.13 or newer, it is hard to suggest what might be wrong. In that case, please send me a ready demo with all the necessary files so that I can reproduce the issue locally.

Hi Ramil,

I updated the gantt version since to the newer one and that has resolved in the sandbox. We have updated the version to Production and monitoring for any issues from users, will update if we face any issue or if its working well.

Thank you,
Rohit

1 Like