-
-
Notifications
You must be signed in to change notification settings - Fork 105
throw _iteratorError #62
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
Comments
Yeah not really, that would imply releasing a 1.2.1 with that ;) |
if (this.validPushTypes.indexOf(pushType) < 0) {
throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED,
'Push to ' + pushType + ' is not supported');
} This is already present in |
Shouldn't the push config be:
|
It does support array or no array: let apnsArgsList = [];
if (Array.isArray(args)) {
apnsArgsList = apnsArgsList.concat(args);
} else if (typeof args === 'object') {
apnsArgsList.push(args);
} else {
throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED,
'APNS Configuration is invalid');
} So leaving the array away as I only have one certificate per deviceType is valid. It makes no difference to the error message if I add the arrays to the push config (just tried that). |
uhh that's odd... |
I think try {
for (var _iterator = pushTypes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var pushType = _step.value;
if (this.validPushTypes.indexOf(pushType) < 0) {
throw new _parse2.default.Error(_parse2.default.Error.PUSH_MISCONFIGURED, 'Push to ' + pushTypes + ' is not supported');
}
switch (pushType) {
case 'ios':
case 'tvos':
case 'osx':
this.senderMap[pushType] = new _APNS2.default(pushConfig[pushType]);
break;
case 'android':
case 'fcm':
this.senderMap[pushType] = new _GCM2.default(pushConfig[pushType]);
break;
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
} This is in |
I know there will be no problem with |
I am facing the same problem with ios push notification,
Here's the error
|
Seems to be a problem with the babel bump |
If I remove the push: {
ios: {
pfx: __dirname + '/certs/' + process.env.APNS_IOS_CERTIFICATE, // The filename of private key and certificate in PFX or PKCS12 format from disk
bundleId: process.env.BUNDLE_ID_IOS, // The bundle identifier associate with your app
production: is_production // Specifies which environment to connect to: Production (if true) or Sandbox
}
// ,osx: {
// pfx: __dirname + '/certs/' + process.env.APNS_OSX_CERTIFICATE, // The filename of private key and certificate in PFX or PKCS12 format from disk
// bundleId: process.env.BUNDLE_ID_OSX, // The bundle identifier associate with your app
// production: is_production // Specifies which environment to connect to: Production (if true) or Sandbox
// }
} So maybe there is some other issue with the configuration of @MamdouhSar but the error message is not displayed correctly due to babel? |
Perhaps an issue with babel, let's see if we can either fix it or remove babel altogether :) |
Any update on this? |
please update to the latest version of parse-server and open a new issue if needed. |
I am running version
1.2.0
of parse-server-push-adapter. I addedosx
push config to my server configuration. Now the app crashes on startup withthrow _iteratorError
.This is how my push config does look like:
All configuration variables are set.
Expected:
parse server push adapter should throw an error that
osx
is unsupported push type as this is only supported with release1.3.0
.Actual result:
It crashes with
throw _iteratorError;
.thoughts:
I think
_iteratorError
in this case is actually the correct error I expect (throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED, 'Push to ' + pushType + ' is not supported');
. However parse server does not print the error correctly to the user as you can see here: https://github.com/ParsePlatform/parse-server/blob/c1dcaf12712eb025d502387e564d3b9c1093a768/src/Adapters/AdapterLoader.jsTherefore I never see the actual error message. Maybe this is an error of
parse-server
in this case.The text was updated successfully, but these errors were encountered: