atomic-server
atomic-server copied to clipboard
Sveltekit 404 SSG template - rebuild strategy and new pages
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
Siteresource, 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.