Skip to content

Commit 3ea54e4

Browse files
committed
fix: use relative paths for GitHub Pages subpath deployment
All asset references (bundle.js, sw.js, manifest.json, workers, icons) used absolute paths from root (/) which broke when served from /agent-comms/ on GitHub Pages. Switch to relative paths (./) that resolve correctly regardless of deployment base path.
1 parent 69de1e4 commit 3ea54e4

5 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/bridges/user/web/frontend/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>Agent Comms</title>
77
<meta name="theme-color" content="#16213e">
8-
<link rel="manifest" href="/manifest.json">
8+
<link rel="manifest" href="./manifest.json">
99
</head>
1010
<body>
1111
<div id="root"></div>
12-
<script src="/bundle.js"></script>
12+
<script src="./bundle.js"></script>
1313
<script>
1414
if ("serviceWorker" in navigator) {
1515
window.addEventListener("load", function () {
16-
navigator.serviceWorker.register("/sw.js");
16+
navigator.serviceWorker.register("./sw.js");
1717
});
1818
}
1919
</script>

src/bridges/user/web/frontend/manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
"name": "Agent Comms",
33
"short_name": "Comms",
44
"description": "Cross-harness LLM agent communication mesh",
5-
"start_url": "/",
5+
"start_url": "./",
66
"display": "standalone",
77
"background_color": "#1a1a2e",
88
"theme_color": "#16213e",
99
"icons": [
1010
{
11-
"src": "/icons/icon-96x96.svg",
11+
"src": "./icons/icon-96x96.svg",
1212
"sizes": "96x96",
1313
"type": "image/svg+xml"
1414
},
1515
{
16-
"src": "/icons/icon-192x192.svg",
16+
"src": "./icons/icon-192x192.svg",
1717
"sizes": "192x192",
1818
"type": "image/svg+xml"
1919
},
2020
{
21-
"src": "/icons/icon-512x512.svg",
21+
"src": "./icons/icon-512x512.svg",
2222
"sizes": "512x512",
2323
"type": "image/svg+xml"
2424
}

src/bridges/user/web/frontend/mesh-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class MeshClient {
5454
connect(): void {
5555
if (this.worker) return;
5656

57-
const worker = new SharedWorker("/mesh-worker.js");
57+
const worker = new SharedWorker("./mesh-worker.js");
5858
this.worker = worker;
5959

6060
worker.port.onmessage = (event: MessageEvent) => {

src/bridges/user/web/frontend/relay-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class RelayClient {
4545
connect(): void {
4646
if (this.worker) return;
4747

48-
const worker = new SharedWorker("/relay-worker.js");
48+
const worker = new SharedWorker("./relay-worker.js");
4949
this.worker = worker;
5050

5151
worker.port.onmessage = (event: MessageEvent) => {

src/bridges/user/web/frontend/sw.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ declare const self: ServiceWorkerGlobalScope;
101101
const CACHE_NAME = "agent-comms-v1";
102102

103103
const APP_SHELL = [
104-
"/",
105-
"/bundle.js",
106-
"/sw.js",
107-
"/manifest.json",
108-
"/icons/icon-96x96.svg",
109-
"/icons/icon-192x192.svg",
110-
"/icons/icon-512x512.svg",
104+
"./",
105+
"./bundle.js",
106+
"./sw.js",
107+
"./manifest.json",
108+
"./icons/icon-96x96.svg",
109+
"./icons/icon-192x192.svg",
110+
"./icons/icon-512x512.svg",
111111
];
112112

113113
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)