Closed faburem closed 4 years ago
Turns out this was not related to frappe datatable but to the way the framework we are using (Meteor.js) cleans up after itself (spoiler alert: it's bad). For anybody else trying this combination, here is how to resolve it (assuming that you create a datatable instance in the onRendered Callback and store it's reference in the template instance:
Template.yourTemplate.onDestroyed(() => {
Template.instance().datatable.destroy()
Template.instance().datatable = undefined
})
We are occasionally seeing the following error stack in our app using Frappe datatable:
It seems to be related to the timing when the datatable is rendered on the page because it is not happening every time. I am wondering if we could add a check here to prevent this.stylesheet to be null and thus preventing the error stack above: https://github.com/frappe/datatable/blob/3475f6ccaa5b1306dd12927537d752ebc1082756/src/style.js#L122