Since yesterday, we are having issues accessing particular feature in our app. We have query setup natively, but when that query is fired we get following error log on terminal
error: Uncaught internal server error. [TypeError: Cannot read property 'type' of undefined] TypeError: Cannot read property 'type' of undefined
at /home/ubuntu/parse2/node_modules/parse-server/lib/Schema.js:750:38
at Array.filter (native)
at /home/ubuntu/parse2/node_modules/parse-server/lib/Schema.js:749:39
at Schema.getRelationFields (/home/ubuntu/parse2/node_modules/parse-server/lib/Schema.js:760:10)
at Object.untransformObject (/home/ubuntu/parse2/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoTransform.js:757:37)
at DatabaseController.untransformObject (/home/ubuntu/parse2/node_modules/parse-server/lib/Controllers/DatabaseController.js:141:31)
at /home/ubuntu/parse2/node_modules/parse-server/lib/Controllers/DatabaseController.js:773:25
at Array.map (native)
at /home/ubuntu/parse2/node_modules/parse-server/lib/Controllers/DatabaseController.js:772:29
at run (/home/ubuntu/parse2/node_modules/parse-server/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:89:22)
PFA screenshot as well.

When I access this code, it shows error
PFQuery *query = [Group query];
[query whereKey:@"Member" equalTo:[PFUser currentUser]];
[query whereKey:@"RequestStatus" equalTo:@"Accepted"];
[query includeKey:@"GroupID"];
[query includeKey:@"GroupID.AdminID"];
[query includeKey:@"Member"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
Any idea what's happening here? I'm using parse server version 2.2.7
Thanks
I'll Check it out
thanks @flovilmart any luck? It's still showing the same error
UPDATE:
@flovilmart we downgraded parse server version to 2.2.6 and this error went away! There's really something wrong with v2.2.7. I hope in future releases we won't have this kind of problems. I'm closing this issue. Once we update to a new version I'll test this scenario once again and will open it if required. Thanks.
If this bug was introduced in 2.2.7 then it may exist in future versions until the cause can be tracked down and fixed.
As this is an open-source, community project there are some additional things you could do to help find the problem:
I think it's worth reopening this bug as each bug fixed brings parse-server closer to completion.
Yes, let's please reopen this.
This code does it for me:
Parse.Cloud.define('test', function (req, res) { return res.success(); });
var User = Parse.User;
var Tribe = Parse.Object.extend('Tribe');
var user = new Parse.User({ username: 'username', password: 'password' });
user.signUp().then(function () {
var tribe = new Tribe({ name: 'My Tribe' });
return tribe.save();
}).then(function () {
return Parse.Cloud.run('test');
}).then(function () {
console.log('done');
});
verbose: GET /parse/classes/Tribe { 'user-agent': 'node-XMLHttpRequest, Parse/js1.8.3 (NodeJS 5.7.1)',
accept: '*/*',
'content-type': 'text/plain',
host: 'localhost:7357',
'content-length': '333',
connection: 'close' } {
"where": {
"$relatedTo": {
"object": {
"__type": "Pointer",
"className": "Tribe",
"objectId": "ETyaJIwDJj"
},
"key": "users"
}
},
"redirectClassNameForKey": "users"
}
verbose: error: TypeError: Cannot read property 'type' of undefined
at /Users/Ian/Developer/wedo-parse-cloud-code/node_modules/parse-server/lib/Controllers/DatabaseController.js:109:10
at run (/Users/Ian/Developer/wedo-parse-cloud-code/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:89:22)
at /Users/Ian/Developer/wedo-parse-cloud-code/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:102:28
at flush (/Users/Ian/Developer/wedo-parse-cloud-code/node_modules/babel-polyfill/node_modules/core-js/modules/_microtask.js:18:9)
at _combinedTickCallback (node.js:370:9)
at process._tickDomainCallback (node.js:425:11)
It's worth noting that I'm running into this in a test environment where there's no predefined schema.
Sure @steven-supersolid @peeinears I'm reopening this issue. I was waiting for next parse server release as MongoTransform.js & DatabaseController.js files have lots of changes when I compared 2.2.7 version and latest commit. We're working on releasing production build by this weekend, so unfortunately, I won't be able to provide logs and perform test cases. I'll try to get everything ready by Monday. Thanks.
Also experiencing this. Does anyone have a workaround or update? Running 2.2.10
Same problem here in 2.2.10 ;( Please help !
Back to 2.2.6 to get everything running back ...
I was experiencing the same issue, but realized that the key I was querying on didn't exist in my local development database. Once I added that key to the table the error went away.
Closing due to lack of activity, please update to latest parse-server version and reopen if the issue persist.
Don't forget to include your current:
Thanks Flovilmart!
I changed it manually in my parse server code and the issue is fixed.
I had this error for iOS. I found a fix for myself:
I had originally created a column called Destination (which was of type String)
Then, I changed Destination (in my app) to type Destination (a pointer to my class Destination).
However, everytime I would try and save I would get the error:
TypeError: Cannot read property 'type' of undefined
I needed to manually go into my parse dashboard and delete the Destination (of type String) because it was still expecting a String. Then, when I ran my app again, it created a new column called Destination (of type pointer Destination). Then, everything was working well again.
In conclusion, try to make sure that you haven't created the same column name with the wrong type. I am not sure if this is a fix for everyone, but it fixed it for me.
Most helpful comment
I'll Check it out