Skip to content

fix(local-explorer-ui): Add 404 & 500 error components#13158

Merged
NuroDev merged 23 commits intomainfrom
NuroDev/local-explorer-not-found
Apr 9, 2026
Merged

fix(local-explorer-ui): Add 404 & 500 error components#13158
NuroDev merged 23 commits intomainfrom
NuroDev/local-explorer-not-found

Conversation

@NuroDev
Copy link
Copy Markdown
Member

@NuroDev NuroDev commented Mar 31, 2026

Fixes N/A.

Summary

Currently if you visit a route that doesn't exist, or try to access a resource, like a KV or D1 binding, that doesn't exist it crashes the app and shows the generic error message.

Instead we now show a controlled 404 message for unknown routes like /foo and a "Resource not found" error message for when trying to access resources that don't exist.

Additionally this both:

  • Fixes a few minor Tailwind CSS linting warnings.
  • Fixes resource route 404 not found handling properly. Previously resources not found were marked as generic errors.

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: Behaviour tests are due to be added in the future.
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: WIP Experimental feature

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@NuroDev NuroDev self-assigned this Mar 31, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: 4a5f9c0

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 31, 2026

I've reviewed all the changes thoroughly. Let me analyze the PR:

  1. ResourceNotFound.tsx - New component that acts as an errorComponent for all resource routes. The file is named ResourceNotFound but exports RouteError — a mild naming mismatch but not actionable.

  2. __root.tsx - Adds a notFoundComponent for 404 on unknown routes. Looks correct.

  3. Route files (d1, do, kv, r2, workflows) - All add errorComponent: RouteError. This catches any error thrown during loader or rendering.

  4. r2/$bucketName/index.tsx - Reorders validateSearch to be after loader (alphabetical). This is purely cosmetic/linting.

  5. Workflow files - CSS changes: !px-4px-4!, !py-2.5py-2.5!, !p-0p-0!, break-wordswrap-break-word, w-[32rem]w-lg. These are Tailwind v4 syntax updates (important modifier moved to suffix, deprecated utilities replaced).

Everything here looks correct and straightforward. The errorComponent will properly catch loader errors (e.g., when a binding doesn't exist and the API call fails). The notFoundComponent handles unknown routes. The Tailwind changes are valid v4 migrations. The duplicated JSX between notFoundComponent and RouteError is minor — they deliberately have different messages ("Page not found" vs "Resource not found").

No logic bugs, no security issues, no backward compatibility concerns.

LGTM

github run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

✅ All changesets look good

@NuroDev NuroDev marked this pull request as ready for review March 31, 2026 23:16
@NuroDev NuroDev requested a review from a team as a code owner March 31, 2026 23:16
@NuroDev NuroDev requested a review from petebacondarwin March 31, 2026 23:16
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 31, 2026

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/local-explorer-ui/src/components/NotFound.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/components/ResourceError.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/__root.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/d1/$databaseId.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/do/$className.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/do/$className/$objectId.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/do/$className/index.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/kv/$namespaceId.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/r2/$bucketName.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/r2/$bucketName/index.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/r2/$bucketName/object.$.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/workflows/$workflowName.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/workflows/$workflowName/$instanceId.tsx: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/routes/workflows/$workflowName/index.tsx: [@cloudflare/wrangler]

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 31, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13158

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13158

miniflare

npm i https://pkg.pr.new/miniflare@13158

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13158

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13158

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13158

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13158

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13158

wrangler

npm i https://pkg.pr.new/wrangler@13158

commit: 4a5f9c0

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@NuroDev NuroDev requested a review from workers-devprod as a code owner April 2, 2026 11:20
devin-ai-integration[bot]

This comment was marked as resolved.

@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 8, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@NuroDev NuroDev requested a review from petebacondarwin April 9, 2026 14:16
Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Apr 9, 2026
@NuroDev NuroDev merged commit 67be6b0 into main Apr 9, 2026
60 of 61 checks passed
@NuroDev NuroDev deleted the NuroDev/local-explorer-not-found branch April 9, 2026 21:16
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants