dosubot[bot] commented on issue #37989: URL: https://github.com/apache/superset/issues/37989#issuecomment-3906580599
<!-- Answer --> The issue is that **`setThemeMode()` doesn't exist in Superset v6.0.0** - it was [added in PR #36125](https://github.com/apache/superset/pull/36125) after the v6.0.0 release (merged November 2025). This explains why your call to `setThemeMode()` has no effect. In v6.0.0, you need to use [`setThemeConfig()`](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-embedded-sdk/src/index.ts#L250-L260) with the `algorithm` property instead: ```javascript await embedDashboard({ id: dashboard.uuid, supersetDomain, mountPoint, fetchGuestToken: () => fetchGuestToken(dashboard.uuid), dashboardUiConfig: { hideChartControls: true, hideTitle: true }, iframeSandboxExtras: ['allow-top-navigation', 'allow-popups-to-escape-sandbox'], }).then((dashboard) => { // Use setThemeConfig with algorithm property dashboard.setThemeConfig({ algorithm: appTheme === 'dark' ? 'dark' : 'default' }); }); ``` The `algorithm` property accepts `'default'` (light), `'dark'`, or `'compact'`. If `setThemeConfig()` still doesn't work, a few things to check: 1. Verify the MessageChannel is properly established (check browser console for Switchboard errors) 2. There's a [known issue with theme metadata schema changes](https://github.com/apache/superset/issues/37282) in v6.0.0 that can cause silent failures If dynamic theme switching is critical for your use case, upgrading to a post-November 2025 release would give you access to the simpler `setThemeMode()` API. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/a155c7b1-44ed-481b-a2bd-6f6bcd2d991c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a155c7b1-44ed-481b-a2bd-6f6bcd2d991c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a155c7b1-44ed-481b-a2bd-6f6bcd2d991c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a155c7b1-44ed-481b-a2bd-6f6bcd2d991c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a155c7b1-44ed-481b-a2bd-6f6bcd2d991c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a155c7b1-44ed-481b-a2bd-6f6bcd2d991c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a155c7b1-44ed-481b-a2bd-6f6bcd2d991c?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=The%20issue%20is%20that%20%2A%2A%60setThemeMode%28%29%60%20doesn%27t%20exist%20in%20Superset%20v6.0.0%2A%2A%20-%20it%20was%20%5Badded%20in%20PR%20%2336125%5D%28https%3A//github.com/apache/superset/pull/36125%29%20after%20the%20v6.0.0%20release%20%28merged%20November%202025%29.%20This%20explains%20why%20your%20call%20to%20%60setThemeMode%28%29%60%20has%20no%20effect.%0A%0AIn%20v6.0.0%2C%20you%20need%20to%20use%20%5B%60setThemeConfig%28%29%60%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-embedded-sdk/src/index.ts%23L250-L260%29%20with%20the%20%60algorithm%60%20property%20instead%3A%0A%0A%60%60%60javascript%0Aawait%20embedDashboard%28%7B%0A%20%20%20%20id%3A%20dashboard.uuid%2C%0A%20%20%20%20supersetDo main%2C%0A%20%20%20%20mountPoint%2C%0A%20%20%20%20fetchGuestToken%3A%20%28%29%20%3D%3E%20fetchGuestToken%28dashboard.uuid%29%2C%0A%20%20%20%20dashboardUiConfig%3A%20%7B%0A%20%20%20%20%20%20%20%20hideChartControls%3A%20true%2C%0A%20%20%20%20%20%20%20%20hideTitle%3A%20true%0A%20%20%20%20%7D%2C%0A%20%20%20%20iframeSandboxExtras%3A%20%5B%27allow-top-navigation%27%2C%20%27allow-popups-to-escape-sandbox%27%5D%2C%0A%7D%29.then%28%28dashboard%29%20%3D%3E%20%7B%0A%20%20%20%20//%20Use%20setThemeConfig%20with%20algorithm%20property%0A%20%20%20%20dashboard.setThemeConfig%28%7B%0A%20%20%20%20%20%20%20%20algorithm%3A%20appTheme%20%3D%3D%3D%20%27dark%27%20%3F%20%27dark%27%20%3A%20%27default%27%0A%20%20%20%20%7D%29%3B%0A%7D%29%3B%0A%60%60%60%0A%0AThe%20%60algorithm%60%20property%20accepts%20%60%27default%27%60%20%28light%29%2C%20%60%27dark%27%60%2C%20or%20%60%27compact%27%60.%0A%0AIf%20%60setThemeConfig%28%29%60%20still%20doesn%27t%20work%2C%20a%20few%20things%20to%20check%3A%0A1.%20Verify%20the%20 MessageChannel%20is%20properly%20established%20%28check%20browser%20console%20for%20Switchboard%20errors%29%0A2.%20There%27s%20a%20%5Bknown%20issue%20with%20theme%20metadata%20schema%20changes%5D%28https%3A//github.com/apache/superset/issues/37282%29%20in%20v6.0.0%20that%20can%20cause%20silent%20failures%0A%0AIf%20dynamic%20theme%20switching%20is%20critical%20for%20your%20use%20case%2C%20upgrading%20to%20a%20post-November%202025%20release%20would%20give%20you%20access%20to%20the%20simpler%20%60setThemeMode%28%29%60%20API.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37989) -- 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]
