ngrok icon indicating copy to clipboard operation
ngrok copied to clipboard

Crashes when calling disconnect function

Open Viiprogrammer opened this issue 3 years ago • 1 comments

Versions

Electron: v12.0.5 Ngrok (package): 4.0.1 Node: v15.12.0 Ngrok (binary): 2.3.40

When i call ngrok.disconnect() it's crashes with error:

{PATH_TO_APP}\node_modules\ngrok\src\client.js:42
          error.response.body,
                         ^

TypeError: Cannot read property 'body' of undefined
    at NgrokClient.request ({PATH_TO_APP}\node_modules\ngrok\src\client.js:4
2:26)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async Object.disconnect ({PATH_TO_APP}\node_modules\ngrok\index.js:42
:20)
    at async Common.serverStop ({PATH_TO_APP}\src\lib\common.js:19:9)

I checked client.js:42 - it's request(method, path, options = {}). I think this error thrown when sending api/tunnels request.

Viiprogrammer avatar Jun 07 '21 07:06 Viiprogrammer

I think the work being done on #231 will help here. At least it will expose what the real error is underneath the inability to read error.response.body.

philnash avatar Jun 26 '21 07:06 philnash