# Why isn't my backend code working when called from the frontend?

**URL:** <https://forum.wixstudio.com/t/why-isnt-my-backend-code-working-when-called-from-the-frontend/75873>\
**Category:** Ask the community\
**Tags:** wix-auth, wix-members-area, wix, question, code\
**Created:** [January 7, 2026, 12:32pm UTC](https://forum.wixstudio.com/t/why-isnt-my-backend-code-working-when-called-from-the-frontend/75873 "2026-01-07T12:32:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![doug-antill](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doug-antill](https://forum.wixstudio.com/u/doug-antill)\
**Post date:** [January 7, 2026, 12:32pm UTC](https://forum.wixstudio.com/t/why-isnt-my-backend-code-working-when-called-from-the-frontend/75873/1 "2026-01-07T12:32:51Z")

</div>

**I’m having trouble with calling backend functions from the frontend.**

I’ve continued using the deprecated functions but I now need to use some of the new functionality.  
I’ve created a new web module, created a function to elevate members.updateMember and tested my code successfully via Wix Editor. However, if I preview the site to call the function from the front end then no errors are generated but the member information isn’t updated

**Here’s the frontend code**

```javascript
import { elevatedUpdateMember} from 'backend/memberFunctions.web.js'

$w.onReady(async function () {
    console.log(elevatedUpdateMember);
    let contactid = '...' // it is a valid memberid guid
    let changes = {
		"member": {
			"contact": {
				"firstName": "Douglas",
				"customFields": {
					"custom.membershipno": {
						"value":"1"
					}
				}
			}
		}
	}
	elevatedUpdateMember(contactId, changes)
	.then((result) => {
		console.log(`Got the final result:`, result);
		return(result);
	})
	.catch((error) => {
		console.log(error)
	})

```

And the backend

```javascript
import { authentication, badges, members } from "wix-members.v2";
import { Permissions, webMethod } from "wix-web-module";
import { elevate } from 'wix-auth';

export const elevatedUpdateMember = webMethod(
    Permissions.Anyone,
    async (id, changes) => {
        console.log(`into memberFunctionsV2:elevatedUpdateMembee`, id, changes);
        try {
            const elevatedUpdateMember = elevate(members.updateMember);
            let member = await elevatedUpdateMember(id, changes);
            console.log("Updated member:", member);
            return member;
        } catch (error) {
            console.error(error);
            // Handle error
        }
    },
);

```

Can anyone see anything obviously wrong?

Many Thanks

Doug

---

<div class="post-metadata">

**Author:** ![noahlovell](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/noahlovell/32/118920_2.png) [@noahlovell](https://forum.wixstudio.com/u/noahlovell)\
**Post date:** [January 9, 2026, 1:53pm UTC](https://forum.wixstudio.com/t/why-isnt-my-backend-code-working-when-called-from-the-frontend/75873/2 "2026-01-09T13:53:51Z")

</div>

When you say there are no errors, where are you checking for this? In the browser console?

I’d recommend watching the Wix Logs from your site dashboard to see if you’re getting any additional info there - [View Logs using Wix Logs | Velo](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/logs/view-logs-using-wix-logs)

---

<div class="post-metadata">

**Author:** ![doug-antill](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doug-antill](https://forum.wixstudio.com/u/doug-antill)\
**Post date:** [January 14, 2026, 12:39pm UTC](https://forum.wixstudio.com/t/why-isnt-my-backend-code-working-when-called-from-the-frontend/75873/3 "2026-01-14T12:39:24Z")

</div>

I’m using Google Cloud Logs Explorer

---

<div class="post-metadata">

**Author:** ![onemoretime](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/onemoretime/32/104023_2.png) [@onemoretime](https://forum.wixstudio.com/u/onemoretime)\
**Post date:** [January 14, 2026, 4:21pm UTC](https://forum.wixstudio.com/t/why-isnt-my-backend-code-working-when-called-from-the-frontend/75873/4 "2026-01-14T16:21:13Z")

</div>

Hi, @doug-antill !!

It’s not exactly the same topic, but we discussed something similar before, so please feel free to refer to that—it might give you some helpful hints. 😇

> [@Create or Append a Contact with code](https://forum.wixstudio.com/t/create-or-append-a-contact-with-code/74202):
>
> Question: How to create, update or append a contact with a user’s input values Created contacts should appear on the Dash in Customers & Leads \> Contacts right? But nothing has worked yet even at a basic level play_button Attempts (all failed!) : Many thanks!

> [@updateContact() is not updating data on existing contact](https://forum.wixstudio.com/t/updatecontact-is-not-updating-data-on-existing-contact/74905):
>
> I’m having trouble with Briefly explain what’s not working or where you’re stuck Working in wix-crm.v2 What I’m trying to do trying to update the data of a existing contact using a form that will be completed by a user. I have a customized register form for new members. If the new member email exists in the crm contacts in my site, I need to convert this contact to an active member using wixUsersBackend.register, using the email of exsting contact. but I need to update and complete the pe…
