Hi,
I am using invoke method from UI kit in my app (dashboard-gadget) to call a resolver function that fetches issues from jira, using api.asApp().requestJira. The problem is when I change the name of the function (from ‘oldFunctionName’ to ‘newFunctionName’) to something new and update in both, on the frontend and the resolver side I get an error:
ERROR 15:45:26.503 0d1f5a95-10d3-4135-8c30-b05325316b9c Error: Resolver has no definition for 'oldFunctionName'.
at Resolver.getFunction (webpack://jira-dashboard-gadget-ui-kit-2/node_modules/@forge/resolver/out/index.js:47:1)
at Object.resolve (webpack://jira-dashboard-gadget-ui-kit-2/node_modules/@forge/resolver/out/index.js:54:1)
I’ve just tested changing this on my forge UI kit app now, and i wasn’t able to replicate the issue you’re experiencing. Is it possible something hasn’t been updated or has been mis-typed in the change of function name process? to troubleshoot this I would suggest trying something like this:
Create a new resolver function with the new function name, and copy the contents of the old resolver into the new function (adding a console log like console.log("New Function Name")
Save the changes to the resolver
Change the app frontend to call the resolver function using the new function name (maybe do a search to make sure you didn’t miss any mentions of the old function name)
Save the changes to the app frontend
Wait for the forge tunnel to complete the reload
Hard refresh your browser to ensure the new changes are being picked up
Watch in the tunnel to make sure that you see the console log for the new function name.
If everything goes ok then you should be safe to delete the resolver with the name you no longer want to use and deploy your changes to production.
I hope this helps! If so please mark this as resolved, if you’re still stuck maybe share your resolver code and call from the frontend?
The trick with substituting old with new function (steps 1 through 5) worked. Also, hard refresh helped remove stale code from the frontend (backend updated correctly). Thank you!