FrancescoCastaldi commented on issue #45885:
URL: https://github.com/apache/superset/issues/45885#issuecomment-6524012033
### Root Cause Analysis & Solution
With Ant Design v5/v6, DOM elements inherit over 400 CSS custom properties
(`--ant-*`, `--color-*`).
When exporting large tables or dashboards, `dom-to-image-more` iterates
through all computed styles and copies every property inline onto each cloned
node. On a pivot table with 10,000 cells, this produces over 4 million
`style.setProperty` calls, inflating memory usage past 6 GB and causing the
Chrome browser tab to crash (`SIGILL` / Out of Memory).
#### Solution
In `superset-frontend/src/utils/downloadAsImage.tsx`, configure
`filterStyles` in `domToImage` options:
```typescript
filterStyles: (propertyName: string) => !propertyName.startsWith('--')
```
Because CSS custom variables are already evaluated into their corresponding
computed properties (such as background colors, margins, fonts), omitting `--*`
variables from inline cloning does not alter visual rendering while reducing
memory consumption by over 80%.
This fix has been committed and verified in branch
`fix/community-unanswered-issues` (commit `24867d069b9`) at
https://github.com/FrancescoCastaldi/superset/tree/fix/community-unanswered-issues.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]