SolidJSS
SolidJS3y ago
Yuuki

Serve a statically generate Solid.js app to Github Pages

Hi, sorry if this is a trivial question but I literally cannot find an answer anywhere because it seems like everyone only focus on serving Solid Start app to all the hosting services.

After I tried to rund a vite build on my Solid.js web app, I received a dist folder.
Now, normally, I should be able to just commit that folder to Github and use it as the roots of the Github Pages and it would have been working just fine.
However, I just cannot get Github Pages to loads the assets (my css, js files) in the assets folder of the dist.
I am totally at a lost, can anyone who have managed to successfully hosted a Solid.js static app on Github pages provided me with a guide or something that I can follow?
Other framework have a Github Action that just allow us to deploy, but I cannot find one for Solid.js yet.

For context, I tried to open the index.html file form dist folder locally also but that still gives me an error relating to CORS policy.

At this point, I am just at a lost because I tried to do vite preview, it works just fine, so I know it has to be that I am missing something in my build process, and not because of the dist folder itself.

Can someone please give me your step by step on how you manage to host your Solid.js web app on Github Pages?

Thank you for those who read this and willing to help out
image.png
image.png
Was this page helpful?