Forge-tunnel with node 18 does not work

Hi there,

as recommended in the Forge changelog, I’ve update my node version to 18.x

ppasler:~$ npm --version
9.8.1
ppasler:~$ node --version
v18.18.0

This works find for building and deploying (forge deploy)

But I can’t start the forge-tunnel

ppasler:~$ FORGE_DEV_TUNNEL=true forge tunnel --ngrok-config ngrok.yml --verbose

...

=== Bundling code...

✔ Functions bundled.

=== Snapshotting functions...

and then it breaks up, without any error message.

Here’s my setup (linux)

ppasler:~$ npm -g list
/home/ppasler/.nvm/versions/node/v18.18.0/lib
├── @forge/cli@6.18.0
├── @forge/sandbox-tunnel@3.3.0
├── corepack@0.15.3
└── npm@9.8.1

Running it again with node 16 works…

Any thoughts what’s wrong?

1 Like

I’ve same problem… If I can find a way to do this, I will help you :slight_smile:

and the option works for you: forge tunnel --debug ?

Because it keeps throwing me an error that port 8000 is busy if I want to debug. Or else… If this option works for you, how did you configure it ?

Hello,

The FORGE_DEV_TUNNEL environment variable is only useful for the team developing Forge here at Atlassian. It is not required for --ngrok-config to work. Can you please remove the environment variable override and try again?

Also, we’ve had a report that ngrok.yml specified as a relative path doesn’t work properly. We’re working on it and the fix should be in the next Forge CLI release, but meanwhile if you have problems please specify it using an absolute path.

Hi @AlexeyKotlyarov ,

thanks for answer. The point here is, that running the same command in a Node 16 environment works as expected (no Docker tunnel and no 2h ngrok time limit).

I assume the problem is the Node 18 environment.

Cheers,
paul

I’m sorry, but the “no-Docker tunnel” (I’m assuming from Quick tip: Tunneling without Docker (useful for Apple Silicon / M1)), specifically FORGE_DEV_TUNNEL, isn’t officially supported.

We are aware of some crashes in it (including on Node 16, maybe you were lucky there) - you can try disabling the snapshotting as a workaround, but that still comes with no warranty.

We are working on simplifying the tunnel experience (no Docker required) as part of the Native Node.js runtime which is currently in EAP - you might want to give that a try if Docker tunnel gives you problems.

@AlexeyKotlyarov I understand, that this setting is not officially supported. But I couldn’t experience any crashed with Node 16.

Does the tunnel work with Node 18 for you?

I will try disabling snapshotting.

Unfortunately I have the same experience on one of my test apps, the no-Docker option only works on Node 18 if I disable snapshotting.

1 Like

Great, thank you. So if you disable snapshotting, it works for you in Node 18?

Yes, it does. (There are also instructions in the post linked above to only disable snapshotting in the tunnel, YMMV.)

1 Like