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

Navigo (^8.11.1) didn't match any of the registered routes #314

Open
tielebodyn opened this issue Aug 10, 2022 · 6 comments
Open

Navigo (^8.11.1) didn't match any of the registered routes #314

tielebodyn opened this issue Aug 10, 2022 · 6 comments

Comments

@tielebodyn
Copy link

tielebodyn commented Aug 10, 2022

hi, I seem to be having a problem with Navigo 8.11.1.

when I make a singleton of Navigo, I seem to get an error every time I set my rootURL as anything except '/'. I tried http://localhost:1234, which is definitely the correct URL for my local server, but it keeps giving me the ''didn't match any of the registered routes" warning, as you can see in the image. when I use the '/' as root URL it loads my html and JS, but still gives me the same warning (even though it clearly does match my registered route).
I switched to version 7.0.0 and everything works perfectly.
PS: /new-event (from console warning) is a registered route, even though you can't see it an my Index.js

ref: https://stackoverflow.com/questions/73220543/navigo-javascript-routing-every-route-i-register-didnt-match-any-of-the-regist/73302262#73302262

Router.js code:
routes

Index.js:
routes

Console warning:
Warnings

@delgec
Copy link

delgec commented Oct 5, 2022

Same warning.

How can I fix this problem?

@tielebodyn
Copy link
Author

@delgec I fixed it by switching to navigo 7

@delgec
Copy link

delgec commented Oct 7, 2022

@delgec I fixed it by switching to navigo 7

I am also downgrade. Thanks for your reply.

@ilteoood
Copy link

As I can see /new-event is not a registered route.
As you are using a plain string in the on function, it will match exactly that.
You are trying to use the first handler, right? What if you use ':page' as route match string?

@tielebodyn
Copy link
Author

@ilteoood I did infact register the new-event page. I just didn't include it in the screenshot.

@ilteoood
Copy link

@tielebodyn if you want to share a reproduction with stackblitz, I'm happy to help :)

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

3 participants