Forge tunnel with native node and custom UI

I decided to give it a try, added to manifest:
name: nodejs18.x

I am using v18.18.2 node

I am using standard react-sctipts, port 3000, updated forge cli, bridge, ui
But sill getting: Failed to connect to localhost:3000. Check that your service is running.
Does it work with CustomUI ?

1 Like

It’s a bug with Node 18 and DNS resolution: it’s defaulting to ipv6 instead of ipv4 and it can’t reach localhost.
You could manually patch your @forge/tunnel files: I’ve done that in the past and it works… but the easiest solution at the moment is to use Node 20 to run the CLI until Atlassian fixes that problem in their code.


Interesting, so I had to add in manifest node18
name: nodejs18.x
but when I run it on node20 it starts working
Thank you! That will help me go further

Forge tunnel was not working for me with the default runtime and the CLI in node 20.x, I was getting the same error as in the original post, but trying this approach (changing runtime on the manifest) made the tunnel work, although the styles were not appropriately served, so now I’ll try to figure out why.
Note: the deployed app is working with styles and everything so it’s only an issue with the tunnel.

A post was split to a new topic: Forge cannot find module when using Forge Tunnel