Skip to content
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

Path pattern match panic #3608

Open
ThatBigDerp opened this issue Feb 14, 2025 · 1 comment
Open

Path pattern match panic #3608

ThatBigDerp opened this issue Feb 14, 2025 · 1 comment

Comments

@ThatBigDerp
Copy link

ThatBigDerp commented Feb 14, 2025

Describe the bug
When I try matching path to route (using wildcard) it panics while parsing regex
Leptos Dependencies

leptos_actix = { version = "0.7.7", optional = true }

leptos = { version = "0.7.7", features = ["nightly", "islands"] } + ssr + hydrate
leptos_meta = "0.7.7" + ssr
leptos_router = { version = "0.7.7", features = ["nightly"] } +ssr

To Reproduce
Create Router with path being WIldcardSegment.

Expected behavior
It doesn't panic

Additional context
Here is part of the code in particular:

#[cfg(feature = "ssr")]
pub fn shell(options: LeptosOptions) -> impl IntoView {
    let formatter = |text| format!("Formatted title: {text}");
    provide_meta_context();
    view! {
        <!DOCTYPE html>
        <html lang="en">
            <head>
                <meta charset="utf-8"/>
                <meta name="viewport" content="width=device-width, initial-scale=1"/>
                <MetaTags/>
                <AutoReload options=options.clone() />
                <HydrationScripts options islands=true/>
                <Title formatter/>
                <Stylesheet id="leptos" href="/pkg//style.css"/>

            </head>
            <body>
                <App/>
            </body>
        </html>
    }
}



#[component]
pub fn App() -> impl IntoView {
    view! {
        <Title text="Test" />
        <Router>
        <main>
            <Routes fallback=|| "Page not found.".into_view()>
                <Route path=path!("") view=HomePage/>
                <Route path=path!("/*any") view=NotFound/>
            </Routes>
        </main>
        </Router>
   }
}
@gbj
Copy link
Collaborator

gbj commented Feb 16, 2025

I can't reproduce a panic using the code provided above. Could you provide some more details, or maybe a repo that reproduces the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants