Skip to content

Fix bedhost-ui worker: name assets binding ASSETS#276

Merged
nsheff merged 1 commit into
masterfrom
fix-assets-binding
Jun 16, 2026
Merged

Fix bedhost-ui worker: name assets binding ASSETS#276
nsheff merged 1 commit into
masterfrom
fix-assets-binding

Conversation

@nsheff

@nsheff nsheff commented Jun 16, 2026

Copy link
Copy Markdown
Member

The worker.ts entry-point falls back to env.ASSETS.fetch(request) for normal (non-crawler) requests, but ui/wrangler.jsonc declared the assets block with no binding. So env.ASSETS was undefined and every deep route returned HTTP 500 (/ worked only because index.html is served directly without invoking the worker).

Adding "binding": "ASSETS" fixes it — verified by deploy: /bedset, /bed, /search, /about all now return 200 with SPA fallback. Needed before cutting bedbase.org over to this worker.

worker.ts falls back to env.ASSETS.fetch() for non-crawler requests, but
the assets block had no binding name, so env.ASSETS was undefined and every
deep route 500'd (root worked because index.html is served directly). Adding
"binding": "ASSETS" restores SPA routing.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deploying bedhost-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6c84937
Status: ✅  Deploy successful!
Preview URL: https://2ecc853a.bedhost.pages.dev
Branch Preview URL: https://fix-assets-binding.bedhost.pages.dev

View logs

Copilot AI review requested due to automatic review settings June 16, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the bedhost-ui Cloudflare Worker static assets binding so that the Worker’s env.ASSETS.fetch(request) fallback works for SPA deep routes (preventing HTTP 500s on non-root paths).

Changes:

  • Add "binding": "ASSETS" to the assets block in ui/wrangler.jsonc so env.ASSETS is defined at runtime.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nsheff nsheff merged commit 3436061 into master Jun 16, 2026
3 checks passed
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.

2 participants