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

failed to register Get route for /:path pattern: insertion failed due to conflict with previously registered route: //' #33

Closed
gytis-ivaskevicius opened this issue Jul 28, 2023 · 1 comment

Comments

@gytis-ivaskevicius
Copy link

Hi, I was having an issue with Cloudflare worker-rs router but then I realized that the error is coming from this dependency

Issue: cloudflare/workers-rs#362

TL;DR:
How do I create such routing:

    Router::new()
        .get("/abc/:path", |_req, ctx| {
            Response::ok("Hello world")
        })
        .get("/:path", |_req, ctx| {
            Response::ok("Hello world2")
        })
        .run(req, env).await

Right now this is the error I'm getting:

panicked at 'failed to register Get route for /:path pattern: insertion failed due to conflict with previously registered route: //', /home/gytis/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/worker-0.0.17/src/router.rs:327:21

I'd be okay with a solution using matchit on its own but I am not sure how to wire it with Cloudflare just yet

@ibraheemdev
Copy link
Owner

ibraheemdev commented Jul 28, 2023

workers-rs seems to be using an old version of matchit. Your routes should not conflict on the latest release.

I'll close this because it doesn't seem actionable on matchit's end.

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

No branches or pull requests

2 participants