Skip to content

feat(template): add a not-found page for unknown routes - #698

Open
pffigueiredo wants to merge 2 commits into
mainfrom
template-not-found-page
Open

pffigueiredo wants to merge 2 commits into
mainfrom
template-not-found-page

Conversation

@pffigueiredo

@pffigueiredo pffigueiredo commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

The template's router lists / and one route per enabled plugin, with no catch-all. Any other path, such as a mistyped URL or a link to a page the app doesn't have, renders React Router's built-in error page: "Unexpected Application Error! 404 Not Found". In development it also adds a "Hey developer" note asking for an ErrorBoundary or errorElement. App Builder runs the app in development mode in its preview, so builders have hit that page there.

What

A * route inside Layout, after the plugin routes, renders a new NotFoundPage. The page is built from appkit-ui's Empty state components, keeps the header and nav, shows the path that didn't match, and links back to / with the template's Button.

Notes:

  • Only newly created apps get this. Existing apps keep their App.tsx.
  • An error thrown while a page renders still reaches React Router's default error page, not the template's ErrorBoundary. Fixing that needs an errorElement, which is a separate change.
  • Regenerating the app templates with tools/generate-app-templates.ts carries the change to them.

Screenshots

Page not found at /does-not-exist

Testing

  • pnpm exec tsx tools/smoke-test-template.ts --package-manager pnpm --run passed: scaffold, lint, build, and serve.
  • Served the built app and opened /does-not-exist in Chrome. The page renders inside the layout, and "Back to home" navigates to /.
  • pnpm check: formatting clean.

The template's router has no catch-all route, so any path outside the
plugin pages renders React Router's built-in "Unexpected Application
Error! 404 Not Found" page, which in development also asks for an
ErrorBoundary. A catch-all route inside the layout now renders a "Page
not found" page that keeps the header and nav and links back home.

Signed-off-by: Pedro Figueiredo <[email protected]>
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AppKit PR bot

🔬 Run evals

Start an eval for this PR from the evals-monitor app: Go to Evals Monitor →

📦 Try this PR's app template

Scaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh auth login — and the Databricks CLI):

gh run download 40867517677 -R databricks/appkit -n appkit-template-0.89.0-pr.2e1c3b9-template-not-found-page-698 -D appkit-pr-698 \
  && unzip -o "appkit-pr-698/appkit-template-0.89.0-pr.2e1c3b9-template-not-found-page-698.zip" -d "appkit-pr-698" \
  && databricks apps init --template "appkit-pr-698"

The template pins @databricks/appkit and @databricks/appkit-ui to tarballs built from this branch, so the scaffolded app runs against this PR's code.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant