TypeError: Cannot read property 'stack' of undefined for Action on google node module
See original GitHub issueI am using Firebase cloud functions as webhook for my action-on-google dialogflow fulfilment.
I am showing only part of My index.js file as below
process.env.DEBUG = 'actions-on-google:*';
var requestcall = require('request');
var date = require('date-and-time');
var promise = require('promise');
var AmazonDateParser = require('amazon-date-parser');
var moment = require('moment-timezone');
var accountnum;
var accessToken;
var timePeriod;
var acctnums =[];
const OUT_CONTEXT = 'output_context';
const ACCOUNT_ARG = 'info';
const ACCOUNT_NUM = 'myAccountNum';
const AccountNums = 'AccountNums';
const CURRENCY_SYMBOL = 'CurrencySymbol';
const TIME_ZONE = 'TimeZone';
const STATS_ARG = 'nextStatsData';
const {dialogflow} = require('actions-on-google');
const functions = require('firebase-functions');
const {
SimpleResponse,
BasicCard,
Image,
Suggestions,
Button
} = require('actions-on-google');
const app = dialogflow(
{debug: true,clientId: 'xxxxxxxxxxx.apps.googleusercontent.com'});
app.intent('Default Welcome Intent', (conv) => {
console.log('Request headers: ' + JSON.stringify(conv.headers));
console.log('Request body: ' + JSON.stringify(conv.body));
accessToken =conv.body.originalDetectIntentRequest.payload.user.accessToken;
console.log('accessToken: ' + accessToken);
if (accessToken !== null) {
return getaccountDetails(conv).then((entity)=>{
return getMessageFromAccount(entity,conv);
});
}
else{
return conv.close(new SignIn('To get your account details'));
}
});
exports.stats = functions.https.onRequest(app);
My package.json file is as below
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase serve --only functions",
"shell": "firebase experimental:functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"dependencies": {
"actions-on-google": "^2.12.0",
"amazon-date-parser": "^0.1.5",
"date-and-time": "^0.6.3",
"dialogflow": "^0.6.0",
"firebase-admin": "^6.5.1",
"firebase-functions": "^3.9.0",
"moment-timezone": "^0.5.31",
"node-pre-gyp": "^0.15.0",
"promise": "^8.1.0",
"request": "^2.88.2"
},
"engines": {
"node": "10"
},
"devDependencies": {
"firebase-functions-test": "^0.2.1"
},
"private": true,
"version": "1.0.0",
"main": "index.js",
"author": "",
"license": "ISC"
}
I am getting the following error while testing my actions-on-google
at standard.then.catch (/workspace/node_modules/actions-on-google/dist/framework/express.js:37:32)
at process._tickCallback (internal/process/next_tick.js:68:7)
Error is not in my index.js. The error is in actions-on-google npm modules library at express.js.
I deleted my node modules and installed again and rebuild the code. still same error coming.
Please help me in solving this issue.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Cannot read property 'stack' of undefined for Action on google
Error is not in my index.js. The error is in actions-on-google npm modules library at express.js. I deleted my node modules and installed...
Read more >Node.js v19.3.0 Documentation
If the values do match, or if the string argument is of another type than string , an AssertionError is thrown with a...
Read more >How to Fix TypeError: Cannot read Property 'push' of ...
You call the method on a variable previously set to undefined . · You call the method on a variable before it has...
Read more >Cannot read properties of undefined (reading 'id') - TrackJS
TypeError is a subset of JavaScript Error that is thrown when code attempts to do something that does not exist on the target...
Read more >Resolving the JavaScript Promise Error "TypeError: Cannot ...
TypeError - Cannot read property 'then' of undefined is thrown when the caller is expecting a Promise to be returned and instead receives ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Fleker can you drop your mail, i will send you my whole code zip folder so that you can check that. if you have problem sharing your mail publicly please reply to my mail i will forward you.
my mail id : sivasankar.android@gmail.com.
I am not encountering this error when trying this on my own example project.