Resolver has no definition for 'function that is not there any more '

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)

My manifets looks like this:

modules:
  jira:dashboardGadget:
    - key: app-dashboard-gadget
      title: 
      description:
      thumbnail: 
      resource: main-resource
      render: native
      resolver:
        function: resolver
      edit:
        resource: main-resource
        render: native
  function:
    - key: resolver
      handler: index.handler
resources:
  - key: main-resource
    path: src/frontend/index.jsx
app:
  runtime:
    name: nodejs20.x
  id: ari: 
permissions:
  scopes:
    - read:jira-work
    - read:jira-user

When I change the name to ‘oldFunctionName’ everything works as expected.
Please let me know if you need more input.

Hey @Konrad,

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:

  1. 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")
  2. Save the changes to the resolver
  3. 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)
  4. Save the changes to the app frontend
  5. Wait for the forge tunnel to complete the reload
  6. Hard refresh your browser to ensure the new changes are being picked up
  7. 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?

Cheers
Mel

Hi @Mel,

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!

Cheers,

Konrad