-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Throw an error (or warn?) if using adapter-static with invalid routes #4287
Comments
I'm for warn, but not error... Sometimes I want to have implemented endpoints with post/patch/delete or hooks and other dynamic server stuff, and use |
Prerendering happens automatically, regardless of what adapter you're using. In the rare case that an adapter doesn't specify where the prerendered output should be copied to, it's accessible at |
I'm a bit confused about what's supposed to work and what not. I'm using the page routing (via slugs in file names), matchers and page endpoints (only GET). It's working when starting the dev environment but not when building it with adapter-static and deploying it to gh-pages. Not going into any specifics here. If you say all three features generally should work, I will dig deeper and eventually open an issue to sort it out. |
Okay, I can give some answers to that myself. All three functions also work with adapter-static. For page routing and page endpoints one just needs to use For example for
The list of entries to prerender can actually be generated similar to how it's done in this blog post: https://reecemay.me/articles/tip_sveltekit_static_pages_with_prismic/ For the matcher one needs to add a fallback for pages not matching the matcher and a fallback for slugs which match but have no prerendered page. It would definitely help to mention these details in the docs on routing with respect to adapter-static. |
sometimes I have reason to not prerender (for adapter-node), mainly if it shows different content to different users. |
Describe the problem
adapter-static
is a source of confusion for people who believe that it allows you to somehow publish an app with dynamic server rendering and/or endpoints with POST/PATCH/DELETE/etc handlers to GitHub pages.Describe the proposed solution
I haven't thought deeply about the implementation, beyond this:
adapter-static
should throw an error unlessfallback
was specified.adapter-static
should throw an error regardless of whetherfallback
was specified.Alternatives considered
More complete documentation, and spending more time dealing with issues
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: