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

500 TypeError at views/account/profile.jade:37 Img not a string or buffer #69

Closed
lequeso opened this issue Feb 13, 2014 · 4 comments · May be fixed by heroku/hackathon-starter#2 or heroku/hackathon-starter#6

Comments

@lequeso
Copy link

lequeso commented Feb 13, 2014

Steps to reproduce:

  1. Login with GitHub strategy
  2. Navigate to: "My Account"

Seems the app is unable to get the Gravatar img:
profile.jade:37 = img(src="#{user.gravatar()}", class='profile', width='100', height='100')

The full error I get is:
Express
500 TypeError: /home/dev/gits/lequeso/hackathon-starter/views/account/profile.jade:37
35| label.col-sm-2.control-label(for='gravatar') Gravatar
36| .col-sm-4
> 37| img(src="#{user.gravatar()}", class='profile', width='100', height='100')
38| .form-group
39| .col-sm-offset-2.col-sm-4
40| button.btn.btn.btn-primary(type='submit')

Not a string or buffer

@sahat
Copy link
Owner

sahat commented Feb 13, 2014

I followed your instructions to re-create the problem and it seems to work fine here. Could you provide more information? @lequeso

@lequeso
Copy link
Author

lequeso commented Feb 13, 2014

It seems that for some reason var "this.email" is undefined at models/User.js:59
---> var md5 = crypto.createHash('md5').update(this.email);

I am still investigating...

Error I get at the console:
TypeError: /home/dev/gits/hackathon-starter/views/account/profile.jade:37
35| label.col-sm-2.control-label(for='gravatar') Gravatar
36| .col-sm-4

37| img(src="#{user.gravatar()}", class='profile', width='100', height='100')
38| .form-group
39| .col-sm-offset-2.col-sm-4
40| button.btn.btn.btn-primary(type='submit')

Not a string or buffer
at Hash.update (crypto.js:209:17)
at model.userSchema.methods.gravatar (/home/dev/gits/hackathon-starter/models/User.js:59:38)

@dmamills
Copy link
Contributor

Fix and explantation #71

@sahat
Copy link
Owner

sahat commented Feb 14, 2014

Fixed in pull request #71. Thanks @dmamills .

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