nrswolf
nrswolf

Reputation: 461

Iron Router/Meteor production error

Running into a strange 'error' to do with routing when deploying a Meteor app, both on meteor.com and on heroku. When the application is running locally, everything works fine. However, when the app is deployed - and I've tried this both on meteor.com's simple hosting and on Heroku - I get the default Iron Router setup page with instructions on how to set up my first route, even though the routes are defined correctly and work locally (screenshot below). This happens on all pages in the app.

Here's a screenshot of the page: https://i.sstatic.net/GlNd9.png

Upvotes: 0

Views: 423

Answers (1)

j3r3m7
j3r3m7

Reputation: 782

I ran into this recently may be able to shed some light on the issue.

If you are working fine in development but not in production then the first thing to do is run your development/local version like so:

meteor --production

This runs the local development version in production mode, as it does when deployed to Modulus, Heroku etc.

If you now get the iron router splash page locally you can be sure the issue is due to running in production mode.

Open up your site in Chrome (or your favourite browser) and look in the browser javascript console for errors... I had one in my client events javascript which I had recently changed.

If you have an error fix it then see whether your Meteor app now runs with the --production flag without showing the Iron Router page.

The splash page in my case was a red herring, masking the real error under the hood.

I haven't looked in depth into the difference between the development and production modes but it obviously handles errors differently so you get different behavior in the two modes.

Upvotes: 5

Related Questions