ITADN

Extremely strange hydration error when upgrading leptos-router from 0.8.9 to 0.8.10

#4642Closedwinteler 创建于 2026-03-14
W
wintelercommented
Hello, I think I've stumbled onto a very strange error. When updating leptos-router from 0.8.9 to 0.8.10 (or higher), I get an error during hydration on my website. The first error message I get is `Caught error, status_code: 500, error message: {"InternalServerError":"DB pool missing."}` which is a log in my ErrorDisplay component. As you might expect, the "DB pool missing" error only occurs in an ssr mod: ``` #[cfg(feature = "ssr")] pub mod ssr { ... pub fn get_db_pool() -> Result<PgPool, AppError> { use_context::<PgPool>().ok_or_else(|| AppError::new("DB pool missing.")) } ``` But at the same time, I can't see any request with a 500 error in the console. This is then followed by an hydration error. Everything seems to have loaded correctly in the initial ssr load and I don't see error logs on the server (but maybe adding additional ones would be worth it here). I'll add the complete Debug logs as an attached file. [hydration_error_sharesphere_logs.txt](https://github.com/user-attachments/files/25994649/hydration_error_sharesphere_logs.txt) This error only occurs for very specific conditions: - On the home page - When logged in - For a specific url, my app is [https://sharesphere.space](https://sharesphere.space) and hooking my test environment [https://test.sharesphere.space](https://test.sharesphere.space) to the same database with almost the same parameters (just some difference for the robots.txt and headers, google-site-verification) Here is the [github repo](https://github.com/winteler/sharesphere) for this app. The code in main (or tag v0.0.1) works without issue and the error can be reproduced with feature/upgrade-leptos-router-0-8-10. I tried dumping the database to my dev environment but also could not reproduce it there. I'm not too sure how to proceed but I'm happy to deploy different versions or do other tests to try to pinpoint the issue. I'll create a post in the leptos discord help channel so it's also possible to sync there if we want to deploy some specific version. I guess as a workaround I could try to deploy my app to a different url (https://app.sharesphere.space) since my test environment seems to be fine but I think it would be nice to understand/fix this issue 😅 Maybe it's also possible to avoid it with some changes in my code. **Leptos Dependencies** ```toml leptos = { version = "0.8.12", features = ["nightly", "nonce", "multipart"] } leptos_meta = { version = "0.8.5" } leptos_router = { version = "0.8.10", features = ["nightly"] } leptos_axum = { version = "0.8.6" } ``` **To Reproduce** Unfortunately, I'm currently unable to make a minimal example to reproduce. I'm happy to try if someone has an idea to reproduce what happens in my actual app. **Screenshots** ![Image](https://github.com/user-attachments/assets/79d16746-55a9-4351-aad2-b0e3dcfa5bca) ![Image](https://github.com/user-attachments/assets/ab6b7070-e8e7-463a-bfe3-7f22c770f718) **Next Steps** - [ ] I will make a PR - [ ] I would like to make a PR, but need help getting started - [x] I want someone else to take the time to fix this - [ ] This is a low priority for me and is just shared for your information Thanks a lot for your help and all the great work on Leptos! :)
关闭于 2026-03-18 6 条评论