You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "marunrun (via GitHub)" <gi...@apache.org> on 2025/09/17 08:24:40 UTC

[I] 【6.0.0】EmbeddedRoute Loading Theme error [superset]

marunrun opened a new issue, #35167:
URL: https://github.com/apache/superset/issues/35167

   ### Bug description
   
   When  i using the embedded SDK, got an error.
   ```
   useTheme() could not find a ThemeContext. The <ThemeProvider/> component is likely missing from the app.
       at useTheme (webpack-internal:///./packages/superset-ui-core/src/theme/index.tsx:61:11)
       at Loading (webpack-internal:///./packages/superset-ui-core/src/components/Loading/index.tsx:64:65)
   ```
   https://github.com/apache/superset/blob/dced2f8564ce65161312ee579dc47359958d4c15/superset-frontend/packages/superset-ui-core/src/components/Loading/index.tsx#L61-L71
   
   https://github.com/apache/superset/blob/dced2f8564ce65161312ee579dc47359958d4c15/superset-frontend/src/embedded/index.tsx#L93-L102
   
   Because the latest Loading used useTheme.
   
   But in embedded applications, the Loading component is used as a fallback for Suspense, but it is located outside of EmbeddedContextProviders, resulting in the inability to access the theme context.
   
   ### Screenshots/recordings
   
   <img width="2510" height="906" alt="Image" src="https://github.com/user-attachments/assets/e556d7ab-64fe-4636-af5f-01a90c3d4c4d" />
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.


-- 
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: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] 【6.0.0】EmbeddedRoute Loading Theme error [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #35167:
URL: https://github.com/apache/superset/issues/35167#issuecomment-3301916917

   <!-- Greeting -->
   Hi @marunrun! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team.
   
   <!-- Answer -->
   The error happens because the Loading component is used as a Suspense fallback outside of the ThemeProvider context in the embedded SDK. Recent changes to the Loading component added theme integration, so it now requires ThemeProvider to be present higher in the tree. In the current setup, Suspense wraps RootContextProviders (which includes ThemeProvider), but the fallback (Loading) is rendered outside of these providers, causing useTheme() to fail with a missing ThemeContext error. 
   
   To fix this, you need to restructure your component hierarchy so that ThemeProvider (or RootContextProviders) wraps Suspense, ensuring the fallback also has access to the theme context. This architectural issue is confirmed in the code and recent discussions—see [here for details](https://github.com/apache/superset/discussions/32149#discussioncomment-13298133) and [the code reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/embedded/index.tsx).
   
   In short: move ThemeProvider above Suspense, or wrap the fallback in ThemeProvider, so Loading can access the theme context.
   
   
   <!-- 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/fb055e04-d13e-406d-b238-39a98aa10f55?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/fb055e04-d13e-406d-b238-39a98aa10f55?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/fb055e04-d13e-406d-b238-39a98aa10f55?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/fb055e04-d13e-406d-b238-39a98aa10f55?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fb055e04-d13e-406d-b238-39a98aa10f55?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/fb055e04-d13e-406d-b238-39a98aa10f55?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fb055e04-d13e-406d-b238-39a98aa10f55?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35167)


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] 【6.0.0】EmbeddedRoute Loading Theme error [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #35167:
URL: https://github.com/apache/superset/issues/35167#issuecomment-3303890032

   This may be a version mismatch between Superset and the Embedded SDK. Which Embedded SDK version are you using?


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] 【6.0.0】EmbeddedRoute Loading Theme error [superset]

Posted by "marunrun (via GitHub)" <gi...@apache.org>.
marunrun closed issue #35167: 【6.0.0】EmbeddedRoute Loading Theme error
URL: https://github.com/apache/superset/issues/35167


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org