Meteor on Heroku Deployment

2019-07-23 07:02发布

问题:

I am trying to deploy Meteor to a remote Heroku server. I am following this tutorial, but get errors. Any advise would be appreciated please.

When I do the git push heroku master:

However, the server logs:

2016-09-11T18:03:14.757898+00:00 heroku[slug-compiler]: Slug compilation started
2016-09-11T18:03:14.757903+00:00 heroku[slug-compiler]: Slug compilation finished
2016-09-11T18:03:41.646676+00:00 heroku[web.1]: Starting process with command `node build/bundle/main.js`
2016-09-11T18:03:44.098961+00:00 app[web.1]: 
2016-09-11T18:03:44.099230+00:00 app[web.1]: assert.js:93
2016-09-11T18:03:44.099458+00:00 app[web.1]:   throw new assert.AssertionError({
2016-09-11T18:03:44.101174+00:00 app[web.1]: AssertionError: "undefined" === "function"
2016-09-11T18:03:44.101176+00:00 app[web.1]:     at Object.<anonymous> (/app/build/bundle/programs/server/mini-files.js:108:24)
2016-09-11T18:03:44.101177+00:00 app[web.1]:     at Module._compile (module.js:456:26)
2016-09-11T18:03:44.101178+00:00 app[web.1]:     at Module.load (module.js:356:32)
2016-09-11T18:03:44.101179+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2016-09-11T18:03:44.101180+00:00 app[web.1]:     at Module.require (module.js:364:17)
2016-09-11T18:03:44.173228+00:00 heroku[web.1]: Process exited with status 8
2016-09-11T18:03:44.193642+00:00 heroku[web.1]: State changed from starting to crashed
2016-09-11T18:03:44.194826+00:00 heroku[web.1]: State changed from crashed to starting
2016-09-11T18:04:02.230596+00:00 heroku[web.1]: Starting process with command `node build/bundle/main.js`
2016-09-11T18:04:04.559800+00:00 heroku[web.1]: Process exited with status 8
2016-09-11T18:04:04.471328+00:00 app[web.1]: 
2016-09-11T18:04:04.471593+00:00 app[web.1]: assert.js:93
2016-09-11T18:04:04.473451+00:00 app[web.1]:     at wrapPathFunction (/app/build/bundle/programs/server/mini-files.js:77:10)
2016-09-11T18:04:04.473452+00:00 app[web.1]:     at Object.<anonymous> (/app/build/bundle/programs/server/mini-files.js:108:24)
2016-09-11T18:04:04.473453+00:00 app[web.1]:     at Module._compile (module.js:456:26)
2016-09-11T18:04:04.473454+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2016-09-11T18:04:04.473455+00:00 app[web.1]:     at Module.require (module.js:364:17)
2016-09-11T18:04:04.581922+00:00 heroku[web.1]: State changed from starting to crashed

UPDATE

I now try this tutorial with a vanilla meteor app:

meteor create meteor-thewhozoo

But when I try push it to the Heroku server:

I have read that adding the Mongo Database eliminates the request for Credit Card info, but it didn't work for me.

heroku config:set MONGO_URL=mongodb://<dbname>:<password>@ds021026.mlab.com:21026/mongo-thewhozoo

I want to avoid giving my card details for a development environment/proof of concept.

UPDATE

Card details can be avoided. Read this, (see Setting up the build back).

回答1:

I recently was trying to deploy my meteor app to Heroku for the first time the other day. I followed this tutorial and it worked no problem.

https://medium.com/@gautham.gg/deploy-a-meteor-1-3-application-to-heroku-cda1f68ca20a#.wceub1sm3

Hope this helps.



回答2:

You don't need to add card details by using mlab sandbox option for the database & that will give you 500MB slug size (which is more than sufficient for a dev environment).

You can pick the mlab sandbox db from heroku cli using the following command.

$ heroku addons:create mongolab:sandbox