I am glad that starting from fdk 7 support es6+ features of javascript.
However, fdk still throws the following error during testing onConversationCreate
event
❯ fdk run
The local server could not be started due to the following issue(s):
[ERROR] Exception occured while validation: Error while parsing file containing serverless functions. Please use the exports section as recommended in the Serverless Apps section of the SDK documentation.
Although I am on the right & latest version
❯ fdk version
Installed: 7.3.0
Already Up to Date..!
I concluded destructuring is not supported when I saw the following debug logs
(validate.js) running validator event
(event-util.js) error while parsing server file "Line 68: Unexpected token ..."
(event.js) Error: Error while parsing file containing serverless functions. Please use the exports section as recommended in the Serverless Apps section of the SDK documentation.
at Object.getEventsList (/usr/local/lib/node_modules/fdk/lib/utils/event-util.js:112:11)
Where on Line 68 ...
is not supported. My code looks similar to follows
let { data: requesterDetails } = await axios.request(OptsToGetServiceReqDetails);
let OptsToGetCustomFieldDetails = {
url: `/tickets/${ticket_id}/requested_items`,
...OptsToGetServiceReqDetails // `...` destructing here
};
I wonder if there’s any eslint disable rule I could add if this restriction is limited to CLI experience alone.