Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in packages after deployment #148

Closed
vbnlohani opened this issue Sep 26, 2016 · 3 comments
Closed

Problem in packages after deployment #148

vbnlohani opened this issue Sep 26, 2016 · 3 comments

Comments

@vbnlohani
Copy link

Hello,

I used the okalnd:accounts-phone package in my development machine and everything worked fine.
But when i deployed it to heroku, the deployment process was successful but the app shows and error.

On checking the logs, i get the error as

2016-09-26T04:16:11.541017+00:00 app[web.1]: /app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:280
2016-09-26T04:16:11.541033+00:00 app[web.1]:                        throw(ex);
2016-09-26T04:16:11.541034+00:00 app[web.1]:                        ^
2016-09-26T04:16:11.541039+00:00 app[web.1]: 
2016-09-26T04:16:11.541039+00:00 app[web.1]: TypeError: Cannot read property 'meteor' of undefined
2016-09-26T04:16:11.541040+00:00 app[web.1]:     at /app/.meteor/heroku_build/app/programs/server/packages/okland_accounts-phone.js:4:21 
2016-09-26T04:16:11.541041+00:00 app[web.1]:     at /app/.meteor/heroku_build/app/programs/server/packages/okland_accounts-phone.js:888:3
2016-09-26T04:16:11.541042+00:00 app[web.1]:     at /app/.meteor/heroku_build/app/programs/server/boot.js:297:10
2016-09-26T04:16:11.541042+00:00 app[web.1]:     at Array.forEach (native)
2016-09-26T04:16:11.541043+00:00 app[web.1]:     at Function._.each._.forEach (/app/.meteor/heroku_build/app/programs/server/node_modules/underscore/underscore.js:79:11)
2016-09-26T04:16:11.541044+00:00 app[web.1]:     at /app/.meteor/heroku_build/app/programs/server/boot.js:133:5

I checked the file accounts-phone.js to find out that the global variable Package is not defined

(function () {
/* Imports */

**var Meteor = Package.meteor.Meteor;**
var global = Package.meteor.global;
var meteorEnv = Package.meteor.meteorEnv;
var NpmModuleBcrypt = Package['npm-bcrypt'].NpmModuleBcrypt;
var Accounts = Package['accounts-base'].Accounts;

help me with this issue as i have to deploy the app as per the deadline.
Thanks in advance

@gregory
Copy link

gregory commented Oct 17, 2016

@Vaibhav241196 i get the same issue - found a fix?
Re: I had the same issue locally and sounds like meteor npm rebuild fixed it locally. Will go through this code see if we are doing a rebuild properly...

@vbnlohani
Copy link
Author

Hello @gregory ,
Yes I found the fix. Actually the environment variable BUILDPACK_PRELAUNCH_METEOR as explained in the readme file had to be set.
After setting that variable as 1 everything worked fine and I successfully deployed it to heroku

@gregory
Copy link

gregory commented Oct 19, 2016

can you close this issue @Vaibhav241196 ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants