bubenshchykov / ngrok

Expose your localhost to the web. Node wrapper for ngrok.
https://ngrok.com
2.33k stars 317 forks source link

ReferenceError: tunnels is not defined #279

Closed jkdowdle closed 2 years ago

jkdowdle commented 2 years ago

Thank you a ton for maintaining this package! it's been quite helpful.

I ran into an issue where shutting down ngrok seems to reference an undefined variable. I wasn't seeing this in dev, but maybe because after the project is bundled we use strict mode.

ReferenceError: tunnels is not defined

Here is the diff that I think will solve my problem, I'll report back once I test it out.

diff --git a/node_modules/ngrok/index.js b/node_modules/ngrok/index.js
index ee3322a..1155ca3 100644
--- a/node_modules/ngrok/index.js
+++ b/node_modules/ngrok/index.js
@@ -59,7 +59,6 @@ async function kill() {
   if (!ngrokClient) return;
   await killProcess();
   ngrokClient = null;
-  tunnels = {};
 }

 function getUrl() {

I don't see any where that tunnels is being referenced as a global or local variable. So I think, unless I am missing something, it is safe to remove? ~If so I could put up a pr to do so.~ #280

Thanks again!

jkdowdle commented 2 years ago

Closing with https://github.com/bubenshchykov/ngrok/pull/280

Once again, Thanks!