Newbie build question on settings

Hello everyone,

I’ve recently started to learn Meteor and I’ve hit a bit of a snag when trying to use meteor build.

From what I read, this command is supposed to produce a tarball of a deployable node application that can be started simply by calling node main.js

So far so good, but when I get around to starting the app (a plain simple web app, hello world style), I’m getting this error:
TypeError: Cannot read property 'baseURL' of undefined

Which makes sense as the settings.json file that I had in the root of my app is nowhere to be found whithin the bundle, nor were its values copied anywhere.

Could a kind soul please clarify for me what’s supposed to happen with the settings? Should I manually copy them to the folder when I untar the bundle?

Thanks

Very good question! The Guide should really be specific about this.

What you do is minify your json and load it into the METEOR_SETTINGS environment variable:

I also believe that you can pre-load default settings in the build with the flag:
meteor build --mobile-settings

Thanks a lot!

Indeed, using the env var has worked.

–mobile-settings also works, but if not building for a mobile platform then it gets ignored.

Would be great to have a more generic CLI, minifying a large JSON for an env var is somewhat awkward (but at least it works).

Thanks again!

1 Like