-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
People are confused by adapter-static
#5185
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
Comments
There are use cases when you want to use adapter-static without prerendering or fallback, anyway it's good to warn about this... not throw error. |
When? |
I can second that this has been causing confusion for me. In earlier versions of Adapter Static, it was clear that you can render as a SPA by including config.kit.adapter.fallback, or pre-render all routes by including config.kit.prerender.enabled, but now I get messages suggesting that I need to use "hooks" to render as a SPA, but there isn't any documentation on how to do this. |
Judging by the emoji reactions, this is something we should do. I also can't think of a situation where you'd want to use |
@Rich-Harris Consider it done |
Describe the problem
I've lost count of the number of times people have asked "why is my
adapter-static
build output missingindex.html
" (and other similar questions) in Discord. It's always fixed by either addingconfig.kit.adapter.fallback = 'foo.html'
orconfig.kit.prerender.default = true
. To be clear, this is in the documentation, and not having one of these settings does produce a yellow (?) warning during build, but I've found that people tend to lose the yellow warning in the output frombuild
.Describe the proposed solution
When trying to run
svelte-kit dev
orsvelte-kit build
, throw a full-on, red, crash-the-process error stating:Maybe I'm missing some context here, but I don't think there's any case where
adapter-static
should be run without one of those options set, and the fact that it "works" in dev confuses a lot of people.Alternatives considered
No response
Importance
would make my life easier
Additional Information
Happy to work on this one if it's a feature we'd actually like to add.
The text was updated successfully, but these errors were encountered: