Hi,
I am currently upgrading all @forge/* dependencies to their typescript 5 versions. e.g. forge/bridge to 6.0.0.
My vite build that worked fine now builds a Custom UI frontend that cannot connect to the forge bridge. Somehow some global variables the bridge relies on get mangled up in the build…
Has anyone got any solutions?
Some vite things I tried are: reserved __bridge a.s.o but nothing works so far
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
},
// Prevent Terser from breaking Forge's global iframe communication properties
mangle: {
reserved: ['__bridge', 'ForgeBridge'],
},
},
I am always getting the error:
ERROR 23:34:30.820 04099926-379a-49cb-ba17-d9291965da5e BridgeAPIError:
Unable to establish a connection with the Custom UI bridge.
If you are trying to run your app locally, Forge apps only work in the context of Atlassian products. Refer to https://go.atlassian.com/forge-tunneling-with-custom-ui for how to tunnel when using a local development server.
But this has nothing to do with tunneling. It appears in the deployed version. And somehow Atlassian changed how ui bridge hooks into the page from window to global variables or something. Any help would be appreciated. Thanks