Forge App Access Issue After Closing Tunnel

Hi everyone,

I’m running into a frustrating issue with my Forge app. Whenever I close the tunnel and then try to visit my app, I get the error:

“localhost refused to connect.”

The problem is that it takes a long time before I can get things working again, so I end up waiting too long just to test my deployed version.

Has anyone else faced this behavior? Is there a reliable fix or workaround to avoid the long wait time after closing the tunnel?

Any guidance or shared experiences would be really appreciated.

Thanks in advance!

Hi @ankitjangid, thanks for reporting the issue. Could you please provide a bit more information to help me diagnose the issue?

  • What modules are you noticing the delay in?
    • If the modules are UI modules, are you using UI kit or Custom UI?
  • Can you please define “long time”? Are you experiencing delays of seconds/minutes?

Thanks,
Bo

I think this is not uncommon. I haven’t experienced it recently but I’ve also come across this issue in the past. Other developers have also posted about this issue e.g. Forge tunnel / forge deploy cache issues

@ I’m facing this issue across multiple modules in my Forge app, including the Issue panel, Admin page, and Project Settings page. My app uses Custom UI, and whenever the problem occurs, the delay is roughly 5 minutes (I don’t recall the exact duration, but it’s consistently long).

I’ve already tried the following troubleshooting steps:

  • Emptying the cache

  • Performing a hard refresh

  • Disabling cache in the browser’s Network tab

Unfortunately, none of these actions resolved the issue.

If you’re running the Forge tunnel as part of a script that runs other processes (such as with “concurrently” in npm), and you then ^C the main process, the SIGTERM may not be propagated as expected to the Forge tunnel process (leaving the tunnel partially open).

If this applies to you, you can try running forge tunnel once again directly from the command line (not as part of a script). After starting it, you can ^C that process directly to ensure that the tunnel is closed.

I’m not running the Forge tunnel as part of a script. I always start it directly from the terminal, and I use ^C there to stop it — so the issue I’m seeing isn’t related to SIGTERM not propagating through another process.