Need Help : Node.js function doesn't work in APIGEE, works fine in local

These are two methods throws syntax error at runtime. Can anyone tell how can I refactor this code to make it apigee compatible?

ApiTester.prototype.test =  function *test(apiDescription) {
  for (const [config, check] of this.checks) {
for (const issue of check(apiDescription, this, config)) {
  // Attach some metadata to the issue before yielding
  issue.ruleId = config.id;
  issue.severity = issue.severity || config.severity;
  yield issue;
}
}
}
ApiTester.prototype.issue = function (message, element, severityOverride) { return {message, element, severity: severityOverride}; }
Solved Solved
0 4 243
1 ACCEPTED SOLUTION

You are using ES6 JavaScript features and those are not available in the current Node.js hosting on Apigee Edge. Change your sources to be ES5 and it should run just fine.

View solution in original post

4 REPLIES 4

You are using ES6 JavaScript features and those are not available in the current Node.js hosting on Apigee Edge. Change your sources to be ES5 and it should run just fine.

@Jeremy Whitlock

You mean to say change my code compatible with ES5?

Yep, that's what I said: "Change your sources to be ES5 and it should run just fine."

Yup...its lot of work. I had to rewrite whole framework. But anyway thanks for the confirmation.