You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The browser renders the html and css but throws an error: "Tried to access reactive URL outside a component." and "Uncaught (in promise) RuntimeError: unreachable"
Leptos Dependencies
Please copy and paste the Leptos dependencies and features from your Cargo.toml.
For example:
leptos = { version = "0.7.0-gamma", features = ["nightly", "experimental-islands"] }
leptos_axum = { version = "0.7.0-gamma", optional = true }
leptos_meta = { version = "0.7.0-gamma" }
leptos_router = { version = "0.7.0-gamma", features = ["nightly"] }
To Reproduce
Steps to reproduce the behavior:
In the CLI, run: cargo leptos watch
Open the browser at localhost:8080 and view the error in the developer console
Implementing use_location() and use_url() results in the same errors.
If you change Header() in pages/team_page.rs from a #[island] to #[component], the errors goes away.
Additionally, the navigating to the dashboard(or homepage) does not produce an error in the browser. My suspicion is that this page component does not contain an Island, like the team_page.
Router APIs provided via context are not available in islands, because the router is only running on the server.
gbj
changed the title
Browser panics and throws "outside a <Router> component." errors when using use_url() or use_location()
Router hooks not available on the client in islands mode
Oct 8, 2024
Ok so after further testing it turns out that switching from <body> to <div> within an island resolved the issue.
So using in a component is ok, but not in an island.
Describe the bug
The browser renders the html and css but throws an error: "Tried to access reactive URL outside a component." and "Uncaught (in promise) RuntimeError: unreachable"
Leptos Dependencies
Please copy and paste the Leptos dependencies and features from your
Cargo.toml
.For example:
To Reproduce
Steps to reproduce the behavior:
Implementing use_location() and use_url() results in the same errors.
If you change Header() in pages/team_page.rs from a #[island] to #[component], the errors goes away.
Additionally, the navigating to the dashboard(or homepage) does not produce an error in the browser. My suspicion is that this page component does not contain an Island, like the team_page.
Relevant code files:
src/components/header.rs
src/pages/team_page.rs
Expected behavior
For there to be no browser errors, and for all interactivity to work.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
code>>>
https://github.com/bambooyuh/leptos_islands
The text was updated successfully, but these errors were encountered: