This doesn’t seem like a Forge problem, but rather something in your code or Custom UI build configuration trying to connect to localhost. However, there’s not a lot of information here to provide much further assistance.
I’ve seen one other circumstance where this happens.
If you’ve been testing your app using forge tunnel, and then you close the tunnel, any browser windows that have been using that Forge tunnel will continue trying to connect to localhost until you refresh the page.
By refresh the page, I’m referring to a full reload, not navigating to a different Jira issue or Confluence page, since Jira and Confluence are SPAs, and so navigating around doesn’t actually count as a page reload.