TL;DR Forge Tunnel never works for me with Custom UI. In fact, I can reproduce this 100% of the time with an out of the box app made by Forge Create. Outlining what I do below so people can help me figure out what I am doing wrong.
Create the app:
(base) boris@Boriss-MBP abrega % forge create
Creating an app in your current directory:
/Users/boris/repo/abrega
Press Ctrl+C to cancel.
Name your app. The app name can include dashes, spaces, and underscores.
? Enter a name for your app: broken-custom-uitunnel-demo
Start with a template. Each template contains the required files to be a valid app.
? Select a category: Custom UI
? Select a product: Confluence
? Select a template: confluence-macro
âś” Creating app...
â„ą Downloading template
â„ą Registering app
â„ą Creating environments
â„ą Installing dependencies
âś” Created broken-custom-uitunnel-demo
Your app is ready to work on, deploy, and install. We created 3 environments you can deploy to: production, staging, development.
Change to directory broken-custom-uitunnel-demo to see your app files.
(base) boris@Boriss-MBP abrega % cd broken-custom-uitunnel-demo
(base) boris@Boriss-MBP broken-custom-uitunnel-demo %
Add the tunnel and port per https://developer.atlassian.com/platform/forge/tunneling/#connecting-the-tunnel-to-your-own-dev-server so the manifest looks like this:
modules:
macro:
- key: broken-custom-uitunnel-demo-hello-world
resource: main
resolver:
function: resolver
title: broken-custom-uitunnel-demo
description: Inserts Hello world!
function:
- key: resolver
handler: index.handler
resources:
- key: main
path: static/hello-world/build
tunnel:
port: 3000
app:
id: ari:cloud:ecosystem::app/2a88daff-91c3-4ec7-aceb-ac1c7250c04d
cd static/helo-world
npm i
npm run build
npm run start
in a new tab:
forge deploy
forge install
Go to confluence and add the macro to the page.
Inspect the element, and see that the macro is being loaded from CDN:
src="https://5cecd9b9-b383-4579-8a56-a6178d990925.cdn.prod.atlassian-dev.net/2a88daff-91c3-4ec7-aceb-ac1c7250c04d/677639ba-2b20-4d66-8896-21a9c773a57a/5598003d-f5b2-4d85-ab1d-ead515130757/main/_hostname_abrega-dev.atlassian.net/"
Start your tunnel:
forge tunnel --ngrok-config ~/.ngrok2/ngrok.yml
Reload the page. No forge function is run in the tunnel.
Inspect the page, and it’s still pulling from CDN.