GitHub user dosubot[bot] added a comment to the discussion: how to create a new 
page on the superset-frontend

<!-- Answer -->
To add a new page in superset-frontend, create a React component for your page 
(for example, in `src/pages/YourPage/index.tsx`), then register it in 
`src/views/routes.tsx` by adding a new entry to the `routes` array with your 
desired path and component. Superset uses React Router to render these routes, 
so your page will be displayed when you navigate to the path you specified. You 
can see examples of this pattern in the [routes.tsx 
file](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/views/routes.tsx).

If you see "Issue 1011 - Superset encountered an unexpected error," it usually 
means there's a problem with your page component or its registration. Common 
causes are: not registering the route, not exporting the component correctly, 
or the component itself throwing an error during render. The frontend wraps 
each page in an ErrorBoundary, which catches errors and shows a generic error 
message if your component fails to render. The specific "Issue 1011" code is 
likely generated by the backend for HTTP 500 errors, but frontend errors will 
show as "Unexpected error" in the UI. For troubleshooting, check your browser 
console and backend logs for more details, and make sure your frontend assets 
are built correctly by running `npm ci` and `npm run build` in the 
`superset-frontend` directory if you see missing static content errors 
[source](https://github.com/apache/superset/issues/34877).

No extra configuration is needed unless you want to conditionally show your 
page based on feature flags or admin checks, as seen in some existing routes. 
If your page still fails, double-check your component export and route 
registration.


<!-- 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/48936f13-8877-4912-8f57-dbb19430f03b?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/48936f13-8877-4912-8f57-dbb19430f03b?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/48936f13-8877-4912-8f57-dbb19430f03b?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/48936f13-8877-4912-8f57-dbb19430f03b?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/48936f13-8877-4912-8f57-dbb19430f03b?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/48936f13-8877-4912-8f57-dbb19430f03b?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/48936f13-8877-4912-8f57-dbb19430f03b?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=github)&
 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/discussions/35136)

GitHub link: 
https://github.com/apache/superset/discussions/35136#discussioncomment-14399963

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to