I'm writing a Parse app for fun.
I'm using Javascript, Parse, Express, and the error occurs only sometimes when I have a post request.
I have a post form:
form id="eventForm" action="newEvent" method="post">
<div>
<label for="GoingWhere">Where are you headed: </label>
<input type="text" id="where" name="where"></input>
</div>
Running something like this (regardless of the form's size) ends in a 500 error usually next time:
app.post('/newEvent', function(req, res) {
var event = new Event();
//example for future for form submission
event.destination = req.param('destination', null);
event.where = req.param('where', null);
event.expectedBack = req.param('expectedBack', null);
event.emergency = req.param('emergency', null);
event.timeLeaving = req.param('timeLeaving', null);
event.userDescription = req.param('userDescription', null);
event.photo = req.param('photo', null);
event.friendWith = req.param('friendWith', null);
event.travelingWith = req.param('travelingWith', null);
event.meeting = req.param('meeting', null);
event.doing = req.param('doing', null);
event.address = req.param('address', null);
event.save();
res.render(indexPage);
});
If I run it smaller it doesnt tend to break as quickly however there is limited use. Also I can't see why this is occuring this way.
app.post('/newEvent', function(req, res) {
var event = new Event();
//example for future for form submission
event.destination = req.param('destination', null);
event.save();
res.render(indexPage);
});
The only conclusion I've drawn from this was that it occurs when the amount of data (columns) is large. If I delete the table it runs fine. If I use a lot of Object.values it returns the error usually immediately afterwards.
Has anyone else experienced this. Is my hypothesis wrong? Why does it occur only when the table is larger. What can I do to avoid it?
Thanks!