Skip to content

fix: RSS button 500 by bypassing client-side navigation#185

Closed
dobby-coder[bot] wants to merge 1 commit into
mainfrom
fix/rss-button-500
Closed

fix: RSS button 500 by bypassing client-side navigation#185
dobby-coder[bot] wants to merge 1 commit into
mainfrom
fix/rss-button-500

Conversation

@dobby-coder

@dobby-coder dobby-coder Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Closes #183

Cause

The blog page's RSS button used a SvelteKit anchor with href={resolve('/(marketing)/blog/rss.xml')} and no reload hint. The (marketing) layout sets trailingSlash: 'always', so the client-side router redirects /blog/rss.xml to /blog/rss.xml/ on navigation. The +server.js endpoint is prerendered to a file at /blog/rss.xml, so the trailing-slash form falls off the static file map and visitors saw a 500.

Direct URL access (staging.postguard.eu/blog/rss.xml) worked because it isn't subject to the router's trailing-slash rewrite — nginx serves the file directly.

Fix

Add data-sveltekit-reload to the anchor so the browser does a full navigation, bypassing the client router for this link only. The <link rel=\"alternate\"> in <svelte:head> already used a plain href and is not affected.

Verification

  • npm run build succeeds; built build/blog/index.html now contains data-sveltekit-reload=\"\" on the RSS anchor.
  • npx prettier --check and npx svelte-check --threshold warning both clean.
  • curl -I https://staging.postguard.eu/blog/rss.xml returns 200 + content-type: text/xml; /blog/rss.xml/ (the trailing-slash form the router was producing) returns the SPA shell, confirming the route mismatch.

Reviewer quickstart

```
git fetch origin && git checkout fix/rss-button-500 && npm ci --legacy-peer-deps && npm run dev
```

Then open the blog index and click the RSS button — should now load the XML feed directly without a round trip through the SPA router.

Closes #183

The blog RSS button used a SvelteKit anchor with no reload hint. The
(marketing) layout sets trailingSlash: 'always', which causes the
client router to redirect /blog/rss.xml to /blog/rss.xml/ on
client-side navigation. The +server.js endpoint is prerendered to a
file at /blog/rss.xml, so the trailing-slash form falls through to
the SPA shell (or errors), and visitors saw a 500.

Adding data-sveltekit-reload makes the browser perform a full
navigation, bypassing the client router so the static file is served
directly. Direct URLs already worked because they are not subject to
the router's trailing-slash rewrite.
@dobby-coder

dobby-coder Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #202 (consolidation per encryption4all/dobby#53). Closing to keep the queue tidy.

@dobby-coder dobby-coder Bot closed this May 9, 2026
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.

When clicking the RSS button we get a http 500 error

0 participants