atomic-server icon indicating copy to clipboard operation
atomic-server copied to clipboard

Sveltekit 404 SSG template - rebuild strategy and new pages

Open joepio opened this issue 1 year ago • 0 comments

Steps to replicate

  • Build a site with Sveltekit template
  • Use SSG and deploy
  • Add a new page / route
  • View the new page, get a 404

Why this happens

Sveltekit doesn't do hydration on 404 pages.

Solutions

Use a custom 404 page that renders FullPageResource

  • let the client fetch the resource again

Have a rebuild button in Browser UI

  • At the Site resource, for example, we add a link to the WebHook which the content editor can click after making some changes.
  • Even better: if the user has made a new resource somewhere in the children of a Site, show a persistent notification that lets the user click to rebuild.

joepio avatar Nov 25 '24 10:11 joepio