node.jstypescriptdialogflow-eshttps-proxy-agent

Dialogflow error only on node/typescript server


I am having an issue with the dialogflow typescript library (@google-cloud/dialogflow). I have managed to make the dialogflow bot working on the local environment (node/typescript server). However running it locally on a docker or pushing it to the live server will produce the following error:

[ERROR]: /app/node_modules/https-proxy-agent/dist/index.js:55
this.proxyHeaders = opts?.headers ?? {};

This is a node/typescript server and the error is exclusively produced when running following code:

const sessionClient = new dialogflow.SessionsClient({ projectId, credentials });

I have tried to googled this error, but I am unable to find anyone with similar issue. I have checked that the credentials are correctly loading. What is confusing is that the issue does not seem to be with dialogflow, but rather with https-proxy-agent package.

It seems the scope of the problem is beyiond of what I am able to debug/handle. Did anyone had similar error? How did you manage to resolve it?


Solution

  • I faced the same error. I updated Node.js 12 to Node.js 20 and it worked. Hope this helps.