Listening to chat events

I would like to “listen” to chat events.
Inside events.js (under ‘Backend’) I have created the code below: (I did not add any imports )
There are other event handlers in this events.js - they work .

export function wixChat_onMessage(event) {
console.log(chat msg channelId: ${event.channelId})
}

Code was saved and published.

I go to the web site chat and type something - my code isn’t invoked.

any ideas?

thanks

Please see your backend log (from site> setting> site monitoring)

You cant see on console log of your browser

Thanks
I am not checking in the browser.
I check it at Google Operations. (I see the my other backend log messages there )
I expect to find it there.

so let’s see if someone helps:

and you can also post your backend error (if any

I am not sure… but I see the error below (not sure it related)

The last argument to .catch() must be a function, got TypeError: logger(…).debug is not a function

I did another test. I removed everything from events.js

The code below is the only code I have:

export function wixChat_onMessage(event) {
console.log( ‘wixChat_onMessage was called’ )
}

Still - nothing happen in the log and the error below (that may be related) is shown:
The last argument to .catch() must be a function, got TypeError: logger(…).debug is not a function