question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make static adapter truly static

See original GitHub issue

Is your feature request related to a problem? Please describe. I’m not sure if it’s a missing feature, an intended “feature” or just a bug.

Basically, I have a website with some dynamic pages (slugs) that I know at compile time. I want to generate the static pages and make them accessible via a traditional hosting (e.g. apache webserver).

The use case is a blog, where I have dynamic slugs that are fetched at build time and used to generate static pages. The problem is, though, the pages are not generated, instead are left dynamic when using the static adapter and thus, navigating through the web pages works (starting from the root), but when accessing the page directly, this is not found.

Describe the solution you’d like To be able to generate true static pages, creating an html file for all routes, even the dynamic ones. If the target is to create a static website, then it should be possible to have all the pages rendered and stored independently one from another.

Basically, pages like /blog/[slug].svelte should be translated to /blog/my-post-name.html instead of being dynamic even when using the static adapter.

I can’t recall if it was working before the last update of the static adapter or not. I believe it was

Describe alternatives you’ve considered I don’t have other alternatives at the moment.

How important is this feature to you? It’s quite serious, since a user who visits a dynamic page and refreshes the page by accident, gets a 404 - Not found from the apache webserver.

Additional context Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Conduitrycommented, May 14, 2021

Please provide a repro. Links in HTML should already be getting followed when crawling like in Sapper.

2reactions
babichjacobcommented, May 14, 2021

This is already how it works?

Read more comments on GitHub >

github_iconTop Results From Across the Web

adapter static+endpoint / adapter static + refresh page #4142
We're seeing this with the next-29 static adapter and '@sveltejs/kit': 1.0.0-next.294_sass@1.49.9+svelte@3.46.4 deploying onto Cloudflare pages.
Read more >
Dynamic adapter creation for static class from interface
If you really-really want to use interfaces (because it has more than one method), you should create an adapter factory for each interface:...
Read more >
@sveltejs/adapter-static - npm
@sveltejs/adapter-static. Adapter for SvelteKit apps that prerenders your entire site as a collection of static files.
Read more >
@sveltejs/adapter-static | Yarn - Package Manager
Adapter for SvelteKit apps that prerenders your entire site as a collection of static files. If you'd like to prerender only some pages,...
Read more >
Page options • Docs • SvelteKit
If your entire app is suitable for prerendering, you can use adapter-static , which will output files suitable for use with any static...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found