Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPA Mode fallback page contents #3413

Closed
BillBuilt opened this issue Jan 19, 2022 · 2 comments · Fixed by #4954
Closed

SPA Mode fallback page contents #3413

BillBuilt opened this issue Jan 19, 2022 · 2 comments · Fixed by #4954
Labels
documentation Improvements or additions to documentation pkg:adapter-static
Milestone

Comments

@BillBuilt
Copy link

Hello,
I've been looking in to the SPA Mode and I'm really liking the idea, but still left wondering.... what is the fallback page actually supposed to contain? I have found no reference to its actual contents.

From the adapter-static github page:

The fallback page is a blank HTML page that loads your SvelteKit app and navigates to the correct route. For example Surge, a static web host, lets you add a 200.html file that will handle any requests that don't otherwise match. 

This seems a bit vague to me and not sure how it would apply to SvelteKit specifically. In the Surge example it is simply showing the HTML file as being:

<!-- 200.html -->
<script src="app.js"></script>

What would the SvelteKit equivalent be?

Thanks!

(PS: Posting a new discussion as suggested in original thread)

Originally posted by @BillBuilt in #3365 (comment)

@mossaiby
Copy link

@BillBuilt I was wondering for a long time about this; I tried to take it literally blank to start, and to my surprise, the fallback page IS CREATED for you by the adapter-static; it is not an input file you have to create! The documentation is quite cryptic on this subject. Do you want another surprise? Try NOT setting prerender: { enabled: false }! You will receive an identical fallback page in every place you have a route (.svelte file). While being messy, it is surprisingly useful; you won't need special SPA settings on your web server to avoid 404 error when the user starts from anything but the / route. @dummdidumm I will reproduce my answer if @BillBuilt opens another discussion.

Originally posted in #3365 (reply in thread)

@benmccann benmccann added documentation Improvements or additions to documentation pkg:adapter-static labels Jan 20, 2022
@BillBuilt
Copy link
Author

BillBuilt commented Jan 20, 2022

@mossaiby Thanks for that info! I knew I was probably over-thinking it somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation pkg:adapter-static
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants