support
support copied to clipboard
[REACT] Error if task edit dialog was open
Hi, I've noticed that such an error:
gantt.module.js:186582 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'find')
at _CollectionFilter._filterBy (gantt.module.js:186582:1)
at _CollectionFilter.filter (gantt.module.js:22818:1)
at gantt.module.js:22984:1
at me._filtersFunction [as _filterBy] (gantt.module.js:26032:1)
at _CollectionFilter.filter (gantt.module.js:22818:1)
at gantt.module.js:22984:1
at Array.filter (<anonymous>)
at _Collection.onFiltersChanged (gantt.module.js:23986:1)
at _Collection.trigger (gantt.module.js:5337:1)
at _Collection.splice (gantt.module.js:23737:1)
at _Collection.add (gantt.module.js:23525:1)
at _Collection.addFilter (gantt.module.js:23955:1)
at TaskStore.performFilter (gantt.module.js:26328:1)
is thrown after I open and then close the task edit dialog in Gantt (or SchedulerPro), and then close and open Gantt.
2 key things for this error to occur are to have local StateProvide enabled and to instantiate ProjectModel outside of Gannt so it doesn't get destroyed when the Gantt is destroyed.
I attached an example for you to reproduce this issue and also attached a video to show the issue. It's not critical as it doesn't seem to break anything, it's just that it logs an error in the console which is a bit annoying.
task-edit-dialog-local-provider-issue.zip
https://github.com/bryntum/support/assets/75997756/cbcc923f-d31e-4aac-872a-f21df6dd63be