On a site served under a base URL, an error page's icon link still points at the domain root and 404s there. Normal pages are fine as of #227, which emits the favicon from the local Document where BASE_URL is available — but error pages do not render through that component.
What I verified in this repository:
| Fact |
Where |
The root ErrorBoundary is upstream's component, re-exported as-is |
app/root.tsx:27 — export { AppErrorBoundary as ErrorBoundary } from '@myst-theme/site' |
The root route's links() supplies a root-absolute icon |
app/root.tsx — { rel: 'icon', href: '/favicon.ico' } |
That links() is deliberately where error-page head links live |
the comment beside it: root's links() are the only ones that also apply when the root ErrorBoundary renders |
links() cannot be made base-aware |
it takes no arguments in Remix 1.17, and BASE_URL reaches the app only through the root loader |
So the root-absolute href is not an oversight in links() — it is the only thing links() can express, and the base-aware version can only come from a component that receives BASE_URL. Upstream's AppErrorBoundary renders upstream's own Document, which this theme does not pass a base URL to.
I have not inspected the upstream package's internals to confirm how its Document builds head links; the conclusion above rests on this repository's own code and comments. Anyone picking this up should start there.
Scope
Only affects sites served under a sub-path (BASE_URL set) — which is the deployed lecture-wasm shape, and the PR-preview shape. A root-hosted site is unaffected, since the root-absolute path is already correct there. The visible symptom is a missing tab icon on 404 and error pages, so it is cosmetic rather than functional.
Possible directions
- Wrap or replace the root
ErrorBoundary with a local component that renders the theme's own Document, so the base-aware head links apply to error pages too. Keeps the fix in this repository.
- Raise it upstream, so
AppErrorBoundary's document can take a base URL. Wider benefit, but outside this repository's control.
Raised while reviewing #227, whose author flagged it as out of scope for that PR and correct to leave — the acceptance criterion there was only that error pages declare an icon link, which they do.
🤖 Generated with Claude Code
On a site served under a base URL, an error page's icon link still points at the domain root and 404s there. Normal pages are fine as of #227, which emits the favicon from the local
DocumentwhereBASE_URLis available — but error pages do not render through that component.What I verified in this repository:
ErrorBoundaryis upstream's component, re-exported as-isapp/root.tsx:27—export { AppErrorBoundary as ErrorBoundary } from '@myst-theme/site'links()supplies a root-absolute iconapp/root.tsx—{ rel: 'icon', href: '/favicon.ico' }links()is deliberately where error-page head links livelinks()are the only ones that also apply when the rootErrorBoundaryrenderslinks()cannot be made base-awareBASE_URLreaches the app only through the root loaderSo the root-absolute href is not an oversight in
links()— it is the only thinglinks()can express, and the base-aware version can only come from a component that receivesBASE_URL. Upstream'sAppErrorBoundaryrenders upstream's ownDocument, which this theme does not pass a base URL to.I have not inspected the upstream package's internals to confirm how its
Documentbuilds head links; the conclusion above rests on this repository's own code and comments. Anyone picking this up should start there.Scope
Only affects sites served under a sub-path (
BASE_URLset) — which is the deployed lecture-wasm shape, and the PR-preview shape. A root-hosted site is unaffected, since the root-absolute path is already correct there. The visible symptom is a missing tab icon on 404 and error pages, so it is cosmetic rather than functional.Possible directions
ErrorBoundarywith a local component that renders the theme's ownDocument, so the base-aware head links apply to error pages too. Keeps the fix in this repository.AppErrorBoundary's document can take a base URL. Wider benefit, but outside this repository's control.Raised while reviewing #227, whose author flagged it as out of scope for that PR and correct to leave — the acceptance criterion there was only that error pages declare an icon link, which they do.
🤖 Generated with Claude Code