[SOLVED] Meteor --settings Not Working?


#1

This has worked on my system forever:

meteor --settings settings.json

Today all of a sudden, the app builds and runs, but the data in settings.json isn’t loaded into to Meteor.settings. The settings.json file is still there and contains the same data as before.

I have a feeling I’m missing something obvious. What could be causing this?


#2

Things usually not happen “all of a sudden” :slight_smile:. Did you change anything in your project? Upgraded Meteor in the mean time? Changed how you started the app (with the command you posted above you need to be in the same directory your settings.json file is)? Changed permissions of some files?


#3

Yes, I have updated the code in various files as usual during development. I have not upgraded Meteor in the meantime or changed how I start the app. I am of course issuing the command from inside the app directory. The app does launch. File permissions have not been changed.


#4

I see what it is. The code referencing the Meteor.settings is being called twice, once on the server and then again later on the client. Naturally when it gets to the client side the private settings are quite rightly not present.


#5

Glad you figured it out :slight_smile: