Backend events.js onMemberCreated not firing

I am trying to run code when a member is created. According to docs I create an events.js file in the Backend folder and do something like this. But I get no message appear in the developer log. My site is published. Other customers seem to have reported issues with events.js also, but I can’t see a solution.

Ultimately I want to set the member slug to not be the first part of the users email address as this is a privacy risk.

my code in events.js:

export function wixMembers_onMemberCreated(event) {
  console.log("member created");
}