dosubot[bot] commented on issue #40375: URL: https://github.com/apache/superset/issues/40375#issuecomment-4517210470
<!-- Greeting --> Hi @Nuno23C! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> This is a confirmed issue — another user reported the exact same `"Cannot read properties of undefined (reading 'startsWith')"` crash in [#39855](https://github.com/apache/superset/issues/39855) [[1]](https://github.com/apache/superset/issues/39855) when using partial theme configurations in `superset_config.py`. Your root cause analysis is spot-on. The Python backend does a **simple dictionary replacement** — there is no deep-merge logic for theme config overrides [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py). The frontend *does* have token-level merging in `Theme.setConfig()` via spread operator (`{...Theme.defaultTokens, ...(antdConfig.token || {})}`) [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/packages/superset-ui-core/src/theme/Theme.tsx#L154-L161), but by the time a partial token object reaches that code path, other parts of the app have already attempted to read missing properties and crashed. Interestingly, the **UI-based theme editor** works correctly with partial overrides because it uses `_merge_theme_dicts()` — the recursive merge function introduced in PR #35220 for database-stored themes . That same merge logic was never applied to `superset_config.py` overrides, which is the inconsistency. Your workaround (importing and spreading over `THEME_DEFAULT`) is the correct approach until a fix lands. The fix itself would be straightforward — apply the same `_merge_theme_dicts()` logic to config-file themes before passing them to bootstrap data [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/views/base.py#L374). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=34c24461-b783-4fe2-9b38-59a8179ccba5) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset) -- 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]
