Anyone encountered same issue as mine?
when I'm using async function with my script I encounter an error like 'sync functions' is only available in ES8 (use 'esversion:8')'
I already tried to input the
/*esversion: 8 */
also
/* jshint esversion: 8 */
at the first line of my script
May I know what I need to check on my script for me to use the async?
/*esversion: 8 */ << I also tried this /* jshint esversion: 8 */ still the error not resolve.
'use strict';
function main() {
const {BigQuery} = require('@google-cloud/bigquery');
async function query () { << 'sync functions' is only available in ES8 (use 'esversion:8')'
const bigqueryClient = new BigQuery();
const sqlQuery = `SELECT * FROM `sample.dataset` LIMIT 1000;
const options = {
query: sqlQuery,
location: 'US',
params: {serialnumber: 'test', min_word_count: 250},
useQueryCache: false,
};
Package.json
{
"name": "dialogflowFirebaseFulfillment",
"description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"author": "Google Inc.",
"engines": {
"node": "10",
"jshintConfig":{"esversion": 8, "strict": "implied", "devel": true, "node": true, "globals": {} }
},
"scripts": {
"start": "firebase serve --only functions:dialogflowFirebaseFulfillment",
"deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment"
},
"dependencies": {
"actions-on-google": "^2.2.0",
"firebase-admin": "^5.13.1",
"firebase-functions": "^2.0.2",
"dialogflow": "^0.6.0",
"dialogflow-fulfillment": "^0.5.0",
"@google-cloud/bigquery": "^0.12.0"
}
}