Open Crashillo opened 4 years ago
All legacy charts with something like: d3.select(this.container).style(...)
must be refactored. ~Provide just a fallback when this.container
is null~.
UPDATE
It comes up after d3.select
call, therefore, the fallback must be:
d3.select(this.container).node() ? d3.select(this.container).style(...) : 0
I could trace this error to: https://github.com/PopulateTools/gobierto/blob/923210839403e19d2de1b6f19304272311359585/app/javascript/gobierto_budgets/modules/application.js#L51-L62
When the event resize is triggered, the DOM is not ready yet to call jQuery methods or the classes. This is quite common on mobile devices as you use to switch between portrait and landscape modes.
It's necessary to refactor the DOM access, to check if the node actually exists before apply any function to it.
Related issues: https://github.com/PopulateTools/gobierto/issues/2825 and https://github.com/PopulateTools/gobierto/issues/1959
View details in Rollbar: https://rollbar.com/Populate/gobierto/items/2776/