Skip to content

boot: derive the home origin from the page URL, not location.origin - #161

Merged
lannbot merged 1 commit into
mainfrom
fix/pages-home-origin
Sep 7, 2026
Merged

boot: derive the home origin from the page URL, not location.origin#161
lannbot merged 1 commit into
mainfrom
fix/pages-home-origin

Conversation

@lannbot

@lannbot lannbot commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

On the Pages deploy every device failed to boot:

https://polymorph-components.github.io/apps/index.json: the host answered 404

The site is a project Pages site under /polyvisor/, but web/boot.ts sent the kernel location.origin as boot-config.home-origin, dropping the path. The kernel fetches {home-origin}/apps/..., so those went to the host root. Everything else the tab and worker load (config.json, worker.js, the components) is already resolved relative to location.href, which is why only the app registry broke.

Fix: hand the kernel the page's directory URL (new URL(".", location.href), trailing slash stripped). Yields the bare origin for a root-served site (the e2e harness), so nothing changes there. The internal.wit doc and a stale worker comment that asserted location.origin are updated.

Gates: deno task check, deno fmt --check.

Automerge is armed.

A GitHub Pages project site is served under /<repo>/, so the kernel's
{home-origin}/apps/index.json fetch went to the host root and 404ed.
Every other URL the tab and worker resolve is already relative to
location.href; the hello now matches.
@lannbot
lannbot enabled auto-merge September 7, 2026 15:40
@lannbot
lannbot merged commit b0ea5fe into main Sep 7, 2026
2 checks passed
@lannbot
lannbot deleted the fix/pages-home-origin branch September 7, 2026 15:45
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