Meteor.settings.public defined in browser but not cordova?


#1

I have a meteor 1.3.2.4 app hosted on heroku. METEOR_SETTINGS is set correctly on the server. Meteor.settings.public is defined as expected in my browser app, but undefined in my cordova app. I’m sure both apps are pointed at the same server. Anything obvious I might be missing?

(The app does use appcache, in case that might be relevant.)


#2

Curious, had not such issue so long and also using public settings on cordova.

We are running meteor@1.3.4

Update: Try once on server startup: Meteor.settings.public.dummy = "Hello"

If this is available


#3

Thanks for the response! There’s actually no settings object at all, no PUBLIC_SETTINGS on __meteor_runtime_config__, nada.

Tried Meteor.settings = { public: { build: 'foobarbaz' }}; on server startup, but Meteor.settings is still undefined on the client.


#4

I am “in” as we had a PR once about missing public property - see https://github.com/meteor/meteor/commit/09e07c6f4d9f525d6f3d0f0b6b8eba19acdd2ea3

Please check and start your app by:

export METEOR_SETTINGS='{ "version": "test", "public": { "hello": "welcome" } }'
meteor

On server side do a add to Meteor.startup()

console.log(Meteor.settings.inspect());
console.log(Meteor.settings.public.hello);

and if its ok, check on your mobile as well.

There you should only get content of Meteor.settings.public


#5

Meteor.settings looks perfect on the server logs, but on the client it’s still undefined. I’m going to try a few other things: revert to a previous build where this was working and see if it still works, make sure my meteor versions match on the client and the server, etc. I’ll add notes here when I know more.


#6

I have it working now, although I’m afraid I wasn’t meticulous enough to know exactly what was wrong. My best guess at the moment: there was a mismatch between the meteor version the app was expecting and the version on the server.

I’m using heroku-buildpack-horse to deploy, which always pulls the latest meteor version, but my app was built with 1.3.2.4. It may be there was some incompatibility there with what the server was providing and what the client was expecting.


#7

Or maybe it was because I was using meteor build and didn’t use --mobile-settings. =/


#8

Having the exact same issue. Did you ever find the root cause of the issue? mobile-settings didn’t help me.


#9

No, I didn’t ever figure out the root issue. Sorry I can’t be more helpful.