Iron:router not working in 1.3 or 1.3.1 either

I have been struggling to migrate my app from 1.2.1 to 1.3
compilation returns no error the server starts ok but the output on localhost:3000
is always error:“Oops no routes available on client or server”

Any idea what could be causing this?

1 Like

If your routes are now inside your imports folder, you need to make sure that you explicitly import them, are you doing that?

My routes are outside the imports folder:

  1. I now import my routes.js explicitly from within the main client directory
    and the problem still persists
  2. I tried to explicitly import my routes.js from the imports directory still get the error: no routes defined…
  3. I even placed the routes.js directly on the main clients folder, its still not being loaded.

Whats I find strange : the example app localmarket which looks like a 1.2 app runs ok; but they use iron:router@0.9.4 ; I tried this trick but my useraccounts:iron-routing requires a higher version of iron:router.

I am stuck… :frowning2:

Do you use the fastclick package?
There is an issue with adblocker blocking it, resulting in the iron:router showing the 404.

@rjakobsson I have just checked I am not using fastclick.

I just tried running the example localmarket with the latest iron:router and the localmarket is also broken in 1.3 so the app’s trick was to use iron:router@0.9.4

I also thought that I had an issue with Iron:outer and Meteor 1.3.1, however when I started the debugging of the issue I found out that I had a bug in a source file that was loaded, at the client, before the routing source file (actually this file should have been in the server directory and should have been broken also in 1.2.x).

So, my recommendation is to closely examine the console log of the browser.

Thanks that was actually the case here, route.js was trying to load after admin.js which had a error. Placing route.js in lib folder solved this for me.

1 Like