FlowRouter doesn't work as expected!

I am using “ostrio:flow-router-extra” package and I used the usage explanation on their page but unfortunately it didn’t work as expected.

I have my router inside “lib/routers.js” as follows:

FlowRouter.route('/', {
	name: 'home',
    action() {
        BlazeLayout.render('SideNav');
    }
});

and my template as follows:

<template name="SideNav">
	HELLO!!
</template>

All I see is blank white screen when I navigate to the route with no errors,

it doesn’t seem to work because even when navigating to random existence routes, i see blank screen as well with no errors,

I tried creating new project and redo it all from the beginning and I came across the same problem.

What am I doing wrong here?

Difficult to say what you’re doing wrong without seeing the code. Is there anything in the browsers javascript console? Are you importing the templates you are trying to access?

You are only rendering a layout. With BlazeLayout is a rendering manager - you render templates within a layout. Read the docs here: https://github.com/kadirahq/blaze-layout/blob/master/README.md and some more here:
https://github.com/kadirahq/flow-router/blob/master/README.md#rendering-and-layout-management.

When you say that nothing happens when navigating to nonexistent routes, that’s because you haven’t configured a not found route & layout: https://github.com/kadirahq/flow-router/blob/master/README.md#not-found-routes

2 Likes

Thanks what you have mentioned was part of the problem, the other parts was removing the following from “package.json” :

"meteor": {
    "mainModule": {
      "client": "client/main.js",
      "server": "server/main.js"
    },
    "testModule": "tests/main.js"
  }