question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add triggers support for notFound routes

See original GitHub issue

When I add a notFound handler I would expect it to also support triggers because it mimics the interface of the normal routes. But if I go to a unknown route with following notFound handler:

function trigger () {
    debugger;
}

FlowRouter.notFound = {
    triggersEnter: [trigger],
    action: function() {
        debugger;
    }
};

The triggersEnter doesn’t get executed at all.

This is clearly a problem for me as I want to do a hard browser load on the requested not found url. But the action handler doesn’t have the context of the original request just the ‘*’ route.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Lepozepocommented, Oct 21, 2015

You can do it via the Meta package and use it through the action function. There you can set the status code to 404. Here’s my snippet

FlowRouter.notFound =
    action: ->
        if Meteor.isClient
            Meta.set [
                {
                    name:"name"
                    property:"prerender-status-code"
                    content:"404"
                }
                {
                    name:"name"
                    property:"robots"
                    content:"noindex, nofollow"
                }
            ]

        BlazeLayout.render "layout",
            content:"not_found"

0reactions
Lepozepocommented, Oct 21, 2015

I’ve learned a lot from you, I’m glad to help out when I can ^_^

Read more comments on GitHub >

github_iconTop Results From Across the Web

GetStaticProps returning initial notFound never triggers a ...
I am encountering a similar experience (but somewhat in reverse). The initial static page with a dynamic route is built successfully.
Read more >
Express trigger not found route for each route - Stack Overflow
When I run your code, I do not get the output you show, so something about your real code is apparently different than...
Read more >
Angular Router: Child Routes, Auxiliary Routes, Master Detail
This is a comprehensive guide to the fundamental concepts of the Angular Router: routes, paths, components, outlets.
Read more >
Page not found for route "/login" - Netlify Support Forums
I have a problem similar to the ones above, I can't find my route “/login” that ... After adding the rule to one...
Read more >
Troubleshoot and diagnose workflow failures - Azure Logic Apps
To help with debugging, you can add diagnostic steps to a logic app workflow, along with reviewing the trigger and runs history. For...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found