gpt4 book ai didi

javascript - 解析.com : The server returned an invalid response

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:54:38 25 4
gpt4 key购买 nike

使用下面的代码,我遇到了这个错误:

{ 代码:107,消息:“服务器返回无效响应。” }

at User.test.js:65
at User.test.js:60
at wrappedRejectedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5269)
at reject (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5214)
at wrappedRejectedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5281)
at reject (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5214)
at /Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5275
at wrappedRejectedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5269)
at /Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5295
at runLater (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5286)
at then (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5296)
at wrappedRejectedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5276)
at reject (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5214)
at wrappedRejectedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5281)
at reject (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5214)
at /Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5275
at wrappedRejectedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5269)
at /Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5295
at runLater (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5286)
at then (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5296)
at wrappedRejectedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5276)
at reject (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5214)
at /Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5275
at wrappedRejectedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5269)
at /Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5295
at runLater (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5286)
at then (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5296)
at wrappedRejectedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5276)
at reject (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5214)
at /Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5259
at wrappedRejectedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5269)
at /Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5295
at runLater (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5286)
at then (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5296)
at wrappedResolvedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5260)
at resolve (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5193)
at wrappedResolvedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5262)
at resolve (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5193)
at /Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5257
at wrappedResolvedCallback (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5253)
at resolve (/Users/me/Documents/Developments/backend/bower_components/parse/parse.js:5193)
at /Users/me/Documents/Developments/backend/bower_components/parse/parse.js:8344

这是我的代码:

// MAIN.JS
Parse.Cloud.define('findUserWithUsername', function(request, response) {
console.log('MAIN => findUserWithUsername');
user.findUserWithUsername(request.params.username, response.success, response.error);
});

// USER.JS
exports.findUserWithUsername = function(username, success, failure) {
console.log('findUserWithUsername - username: ' + username);
Parse.Cloud.useMasterKey();

var query = new Parse.Query(Parse.User);
console.log('findUserWithUsername - query created')
query.equalTo("username", username).first().then(function(_user) {
if (typeof _user !== 'undefined') {
console.log('findUserWithUsername success -> ' + _user);
success(_user);
} else {
console.log('findUserWithUsername success -> no user found');
success(null);
}
}, function(_error) {
console.log('findUserWithUsername - error: ' + _error);
failure(_error);
});
}

// USER.TEST.JS
function deletePreviousUser(username) {
console.log('deletePreviousUser');
return Parse.Cloud.run("findUserWithUsername", {username: username}).then(function(user) {
console.log('findUserWithUsername succeed');
return (user == undefined) ? Parse.Promise.as() : Parse.Cloud.run("deleteUser", {userId: user.id});
}).then(function(result) {
return Parse.Promise.as();
}, function(_error) {
return Parse.Promise.error(_error);
});
}

我从来没有在 Parse.com 上收到过这样的错误消息,我也不知道它是什么意思。有什么建议吗?

最佳答案

我遇到了同样的错误。
这个错误是在没有修改代码的情况下突然开始出现的。
在我的例子中,从“response.success();”更改代码到“”response.success(“”);”解决了这个问题。

请尝试更改“success(null);”这一行 到“成功(”);“

关于javascript - 解析.com : The server returned an invalid response,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32803999/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com