-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Serving multiple frontends with the same server leads to only one being served #1806
Comments
In the example, you're constructing two different Axum routers that both serve a single route Or am I misunderstanding something about the setup? |
Ah yes I forgot to mention that, they're listening to different ports. And the reason why they have a router each is that I couldn't make it happen without it. As in, it's working properly, |
Oh okay, I understand. Yes, leptos/router/src/components/routes.rs Lines 269 to 289 in 870808e
So I guess if you have two separate apps using I'm open to suggestions for a good solution. |
I'm not sure if that's the issue, I tried the wrap the branches hashmap with another hashmap using a router ID but the result is the same. Or maybe it is only part of the issue -- I imagine the runtimes management in |
Describe the bug
I am trying to create a monolith that serves two web apps (
app1
andapp2
). When I spin up the server, the first web app that's opened (be it eitherapp1
orapp2
) is rendered correctly, but then when the other app is opened, it is rendered as the other app.This is using hydration on the client and SSR on the server. If hydration is replaced with CSR on the client and SSR disabled on the server -- then the render happens twice for each app (because it seems hydration is still enabled), with one of the renders being correct and other not.
Leptos Dependencies
I am using
v0.5.0-rc3
.To Reproduce
Here is a minimal reproduction example, with commands used in the README: https://github.com/sbihel/leptos-multiple-apps
Expected behavior
Each app renders as itself.
Additional context
An example use case for this could be to have a monolith with a user dashboard and an admin dashboard, where the data may be sensitive enough that you want to separate them whilst making it easier to share code. This may not be supported, and it may not even be a good idea. But considering the end result is confusing, and the fact
cargo-leptos
mentions that "several projects can be defined and one package can be used in several projects", I thought this might be of interest.The text was updated successfully, but these errors were encountered: