-
Notifications
You must be signed in to change notification settings - Fork 375
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
Error is thrown when building with solid-start-static #325
Comments
This is something you should fix, but also its a situation that's not expected to work too well because you are doing If you build with a normal adapter. You can just skip the server and deploy the client as static. If you just want a shell. |
Since the solid-start-static adapter has no documentation, it's unclear as to whether ssr should be enabled or not. When I think of "static" I think of a set of HTML and JS files that can be hosted on GitHub Pages or Apache. There's no hydration involved, no API endpoints, no server-side code at all. Since all of those mechanisms are present as a result of enabling "ssr: true", one would naturally think that the correct choice would be to disable SSR. Am I misinterpreting what "static" means? |
Hmm.. this is an interesting question. For someone looking for truly CSR setup the static adapter is the only one that outputs no server so I can understand how we get here. However, the point of the static adapter is to prerender pages so without ssr you aren't really pre-rendering anything. I think we should consider the intersection of these options because I can see this being the logical place to go for someone who primarily wants CSR. Like a Node or Cloudflare Workers adapter isn't actually what you are looking for. I think with ssr: false and static adapter we should just skip pre-rendering probably (outside of the index.html we generate for all ssr: false adapters) |
I solved my problem by using vite-plugin-ssr |
One solution discussed on discord was to not use solid-start for sites like these, but simply use Vite+Solid as @MrFoxPro suggested. Unfortunately this means you lose file-based routing. There was some talk about back-porting file-based routing to solid-router, but I'm not sure if there was any progress in that regard. Yes, it would be nice if solid-start supported this use case, but honestly, it's not all that much work to set up a project with vanilla Vite. Most of the value-add of solid-start is in the realm of server data, which is not an issue in the case I am envisioning. But file-based routing is really nice to have for something like a documentation site, especially when combined with MDX. |
I thought the exactly same, and came along here. So as of today there's no way of achieving this with solid-start, right? I was building a prototype web app with a mock API server, and then I wanted to host it on GitHub Pages to quickly share it with other people. But I admit such use case is not very common. EDIT: After some tweak (including |
@kissge It's a bit confusing, but what is preventing me from deploying to github pages is not this bug, but a different bug: #514. This bug is mostly about the confusion about the It is possible, under some circumstances, to deploy to a static website using the current static adapter. For example, if you are deploying to the root of the domain - something not possible with GH pages, but possible with other kinds of hosting - you can get it to work. For example, if you are deploying to something like Vercel it's fairly easy. However, from what I can tell, the current static adapter also generates a bunch of server-side code (server.js) - which then never gets run. So it "works", but it's not exactly what I would call polished at this point. |
vite-plugin-ssr provides file-based routing and could be extended. |
We intend to cover this case here. It is just has some issues right now.
SSG(static + ssr: true) is even better for that case than Client Side Rendering(ssr: false) I think.
It runs at build time to static render the site in the typical ssr: true setting.
There might be some confusion here. We need that code to create the static content in the first place. All static pre-rendering does is change when it server renders. Otherwise you can just copy |
In setting up for SolidStarts next Beta Phase built on Nitro and Vinxi we are closing all PRs/Issues that will not be merged due to the system changing. If you feel your issue was closed in mistake. Feel free to re-open it after updating/testing against 0.4.x release. Thank you for your patience. See #1139 for more details. |
Repro: https://stackblitz.com/edit/vitejs-vite-dxqnej
Run
pnpm build
The text was updated successfully, but these errors were encountered: