From 0044b4b797e8acb2f58215b8759cac5962fd6ac1 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Tue, 9 Jun 2026 21:38:26 -0400 Subject: [PATCH] Fix unstyled bulletin board on Vercel (cleanUrls/trailingSlash) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vercel.json sets cleanUrls + trailingSlash, so board.html is served at /board/. Its relative asset paths (nostr-client.css, board.js, locales.js, vendor/...) then resolved to /board/... and 404'd, leaving the page as raw unstyled HTML stuck on "Loading…". Use root-absolute paths instead, and point the back link at "/". Add an e2e guard asserting board.html assets are root-absolute (the dev server can't reproduce Vercel's URL rewrites). Co-Authored-By: Claude Opus 4.8 --- e2e/flyer.spec.js | 13 +++++++++++++ site/board.html | 13 ++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/e2e/flyer.spec.js b/e2e/flyer.spec.js index c6f1f05..59a4bed 100644 --- a/e2e/flyer.spec.js +++ b/e2e/flyer.spec.js @@ -176,6 +176,19 @@ test.describe("VoxVera static client", () => { await expect(headers.nth(0).locator(".sort-indicator")).toContainText("▲"); }); + test("bulletin board assets use root-absolute paths (cleanUrls/trailingSlash safe)", async ({ page }) => { + await page.goto("/board.html"); + const refs = await page.evaluate(() => + Array.from(document.querySelectorAll("link[href], script[src]")) + .map((n) => n.getAttribute("href") || n.getAttribute("src"))); + expect(refs.length).toBeGreaterThan(0); + // Vercel serves this page at /board/ — relative asset paths would resolve + // to /board/... and 404, leaving the page unstyled with no scripts. + for (const ref of refs) { + expect(ref, `asset "${ref}" must be root-absolute or external`).toMatch(/^(https?:|\/)/); + } + }); + test("bulletin board language selector localizes the page", async ({ page }) => { await page.goto("/board.html"); await expect(page.locator("#board-title")).toHaveText("Bulletin Board"); diff --git a/site/board.html b/site/board.html index b9b5e47..3ffa2b8 100644 --- a/site/board.html +++ b/site/board.html @@ -4,7 +4,10 @@ VoxVera — Bulletin Board - + +
@@ -13,7 +16,7 @@

Most recent flyers published to the relays.

@@ -24,8 +27,8 @@ - - - + + +