Issue with notFound never triggered
See original GitHub issueI have a simple route like:
router
.on({
'/product/:id': function (params) {
renderProduct(params.id)
},
'/':function() {
renderStartpage();
}
})
.notFound(function() {
pageNotFoundController();
});
If the URL is /
it will go to start page. Also if the URL is /foobar
. I can never seem to be triggering the pageNotFoundController()
.
How should I configure my routes differently? Naturally I only want to valid routes: /
and /product/XX
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
GetStaticProps returning initial notFound never triggers a ...
hi @ijjk we're setting revalidate: 300 if notFound: true is being returned. The problem is pretty much perfectly summarized by the original ...
Read more >How to Fix Error 404 Not Found on Your WordPress Site - Kinsta
The Error 404 Not Found status code indicates that the origin server did not find the target resource. Check out these common causes...
Read more >npm ERR cb() never called - node.js - Stack Overflow
I just had this exactly issue when trying to install the Sage theme for WordPress. When I ran npm install on the theme...
Read more >Microsoft Outlook error: trigger partner failure: Unable to ...
Microsoft Outlook error: trigger partner failure: Unable to retrieve the list of calendar events: The specified object was not found in the ...
Read more >Common errors and troubleshooting tips - IFTTT Help Center
Double-check the trigger and action fields Verify that the intended Ingredients are being used where and how they should be. For example, don't ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I guess I’ve found a workaround for this issue:
@krasimir I changed the position of the
/
to the end instead but nothing really changed. Said two different things in the README.md, so I thought it didn’t matter 😃 I have the latest npm version of navigo so that should be okay.What happens is that if I go to
/asdf
(i.e. a non-existing route) it will just load the/asdf
route as the root route instead. If I then try to navigate to for example/work
, it will instead go to/asdf/work
.I was wondering if it could have something to do with my gulptask if it isn’t Navigo itself?