S
SolidJS4mo ago
Karl

solid-router without SSR and without having to redirect

I just found out that when i build my app with solid-router its only possible to visit the index page on first page load. I saw the section in the readme.
When deploying applications that use a client side router that does not rely on Server Side Rendering you need to handle redirects to your index page so that loading from other URLs does not cause your CDN or Hosting to return not found for pages that aren't actually there.
I havent anticipated that and i need the users to visit a specific route of my app (as it is possible in vite dev mode) . Do i need do use server rendering and solidstart for this to be possible? Is it possible to prebuild the routes for deployment?
4 Replies
Brendonovich
Brendonovich4mo ago
That notice is just referring to configuring your hosting setup to point to/, as client side setups have a single entrypoint. It's not saying that you can only have 1 route, just that /one and /two should both fetch the same entrypoint code.
Karl
Karl4mo ago
Okay i seem to misunderstand this then. Sorry i am relatively new to this and dont really understand. So it will be possible for the users to enter the specific routes? I will deploy with nginx, i will look into how i can redirect to the entrypoint. Thanks
Brendonovich
Brendonovich4mo ago
Yeah they'll be able to access all the routes, just configure nginx to priorities fetching stuff directly from the disk, and then if a path doesn't exist return index.html
Karl
Karl4mo ago
Alright, i will try to set this up. Thank you Yes it works. Thanks!
Want results from more Discord servers?
Add your server
More Posts
Portals in nested routes not rendering in consistent orderCheck out this stackblitz: https://stackblitz.com/edit/solidjs-templates-wwykia Loading `/one/two/thHow do I use solid router in the solid playground?I added solid router to the importmap, but whenever trying to import something it says “Cannot find how to make two-way data transfer through components?I need to pass a value from a child component to a parent component and back again and idk how to maIs createRouteAction removed ? Or Replaced ?Hi, I just updated my version of solid-start and cannot find `createRouteAction` in the docs. Can anPassing "up" signals in SolidI am trying to understand how can you go by reading values from signals defined in children componenuseNavigate - navigate(path) throws "computations created outside a `createRoot`" and errorSometimes (not 100% of the time) when a user selects a new category in the UI, the following code se(node:53181) Warning: An error event has already been emitted on the socket.Has anyone ever encountered the problem: ```bash VITE v4.5.2 ready in 435 ms ➜ Local: httpCan't use an image without src/assets/ at the pathI have a problem why can't I use images from the assets folder if there is no src/assets/image.png asolid-router | return Navigate as componentIs there any way to return `<Navigate href="/auth/login" />` as a component rather than an element? Anchor with target="_blank" leading to app's URLI have a link with the `href` set to an external link for an image. When clicking on this link, a ne