gwilliamnnG
Convex Community3y ago
20 replies
gwilliamnn

Bug after change function

I made a change on my schema, the table before called profile now is called profiles, I change all names on my code, is reflecting on the backend panel at the convex dashboard, but I'm getting this error:
- error Error: Could not find public function for 'profile:update'. Did you forget to run `npx convex dev` or `npx convex deploy`?

    at ConvexHttpClient.mutation (webpack-internal:///(rsc)/./node_modules/.pnpm/convex@1.0.2_@clerk+clerk-react@4.23.1_react-dom@18.2.0_react@18.2.0/node_modules/convex/dist/esm/browser/http_client.js:126:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleClerkWebhook (webpack-internal:///(rsc)/./src/app/(api)/api/webhook/auth/utils.ts:35:17)
    at async eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@13.4.12_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/future/route-modules/app-route/module.js:253:37)


And I call this function here:

if (body.type === "user.updated") {
      const name =
        (body.data.first_name ? body.data.first_name : "No") +
        " " +
        (body.data.last_name ? body.data.last_name : "Name")

      console.log(name)

      await client.mutation(api.profiles.update, {
        userId: body.data.id,
        name,
        email: body.data.email_addresses[0].email_address,
        avatarUrl: body.data.profile_image_url,
      })

      console.log("Profile updated")
    }
Was this page helpful?