Skip to content

Instantly share code, notes, and snippets.

@WillieYang
Last active August 6, 2017 18:02
Show Gist options
  • Select an option

  • Save WillieYang/deb945b9dacaa5b7be2ee017a7556bfd to your computer and use it in GitHub Desktop.

Select an option

Save WillieYang/deb945b9dacaa5b7be2ee017a7556bfd to your computer and use it in GitHub Desktop.
HTTP error: status code ~ 500
responseBody[object Object],[object Object],[object Object]
These two vars are equal.
GET /locationlist/ 500 197.178 ms - 1964
GET /bootstrap/css/pulse.bootstrap.css 304 1.410 ms - -
// Why would this error happen?
// The reason might be that the data in the view cannot match the controller.
GET / 500 19.940 ms - 1838
GET /bootstrap/css/pulse.bootstrap.css 304 1.349 ms - -
GET /stylesheets/style.css 304 1.262 ms - -
// the reason why above erro existed is that the jade only support space rather than tab.
User Registration succesful
serializing user:
{ __v: 0,
email: 'Alice@gmail.com',
password: '$2a$10$25ijkG/tldNNCanzPtKeiOpHl8axF5rH3BER8KFDDmQ6fYooXD3IS',
username: 'AliceYang',
_id: 5974c986dea685349a68242a }
POST /users/signup 302 361.998 ms - 70
GET /users/login/ 500 144.960 ms - 2136
// this kind of error also happens when I use the passport.js to build the use authentication.
// the main reason is that I have imported the user model in a wrong way:
var mongoose = require('mongoose');
var User = mongoose.model('User');
// rather than:
var User = require('../users');
// for I have compiled the Schema to the model using:
mongoose.model('User', UserSchema);
// and I did not use code below:
module.exports = mongoose.model('User', userSchema);
@WillieYang

Copy link
Copy Markdown
Author

In fact, it is the indent problem of jade.

@WillieYang

Copy link
Copy Markdown
Author

We can using arrow and select button to find out whether the lines are space or tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment