I'm trying to develop an application using forge.
However, there is a problem: When I use forge tunnel, whenever a function is called by using invoke("functionName", { } ), always this error:
Error: There was an error invoking the function - 404
But if I turn off forge tunnel, it works normally.
Forge version: 12.8.0
Please helpppp
If invoke() returns 404, it usually means the tunnel isn’t seeing your resolver function locally. The question is why it works if you stop tunnel. It may be because you haven't deployed the new function and when you stop tunnelling, it uses the old version which is why it works.
I'd say, verify the resolver + invoke names. I am sure you should have already checked but make sure it looks like this
Backend
resolver.define('functionName', async (req) => {
return { ok: true };
});
custom-ui
import { invoke } from '@forge/bridge';
await invoke('functionName', { /* payload */ });
Both strings should match. Also make sure the resolver is listed under functions in manifest.yml, and your module references that resolver.
If you've already checked and still not working I'd suggest posting this question on Atlassian Developer Community
Thanks for your answer.
I've already checked the names and I'm sure they matched.
I deployed my app and the problem still remained.
I also created a new app to test, but the problem was there with my new app. So I think it must come from forge itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.