From ad1c8ab947aaee64c95ac0ebf9746cfa96db66e2 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sat, 9 May 2026 08:51:45 +0200 Subject: [PATCH 1/2] fix(build): add prerender entry for /hilfe/transkription MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SvelteKit prerender crawler cannot reach this route because hooks.server.ts redirects all non-public paths to /login before the crawler follows links. Explicitly listing the route in kit.prerender.entries tells SvelteKit to render it directly without crawling. Also removes a misleading comment that claimed the auth hook guards prerendered static files — it does not. Prerendered HTML is served as a static file by the reverse proxy; hooks.server.ts only runs for SSR requests. Closes #472 Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/routes/hilfe/transkription/+page.ts | 2 -- frontend/svelte.config.js | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/routes/hilfe/transkription/+page.ts b/frontend/src/routes/hilfe/transkription/+page.ts index f71b9f54..189f71e2 100644 --- a/frontend/src/routes/hilfe/transkription/+page.ts +++ b/frontend/src/routes/hilfe/transkription/+page.ts @@ -1,3 +1 @@ -// Safe: handleAuth in hooks.server.ts redirects unauthenticated requests -// before prerendered HTML is visible. export const prerender = true; diff --git a/frontend/svelte.config.js b/frontend/svelte.config.js index 03c17f28..ca42a340 100644 --- a/frontend/svelte.config.js +++ b/frontend/svelte.config.js @@ -6,7 +6,10 @@ const config = { // Consult https://svelte.dev/docs/kit/integrations // for more information about preprocessors preprocess: vitePreprocess(), - kit: { adapter: adapter() } + kit: { + adapter: adapter(), + prerender: { entries: ['/hilfe/transkription'] } + } }; export default config; -- 2.49.1 From 997fd5b9919a043081cda7dba59fea097548c7b7 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sat, 9 May 2026 08:52:20 +0200 Subject: [PATCH 2/2] ci: add npm run build step to unit-tests job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prerender fix only prevents regression if the build is actually run in CI. Without this gate, a future prerendered route that becomes unreachable behind auth would fail silently until someone runs the build manually. Fits after the test step in the existing unit-tests job — no new job needed since node_modules is already cached for the Playwright container. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index a2d9d227..9ab8d3e5 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -40,6 +40,10 @@ jobs: run: npm test working-directory: frontend + - name: Build frontend + run: npm run build + working-directory: frontend + - name: Upload screenshots if: always() uses: actions/upload-artifact@v4 -- 2.49.1