Here is my website page https://www.whitehousemedical.com.au/booking-dev
I used Wix simple example as following:
test.jsw
export function multiply(factor1, factor2) {
console.log(‘server’, factor1, factor2); // not working
return factor1 * factor2;
}
front-end:
import {multiply} from ‘backend/test’;
$w.onReady( function () {
multiply(4,5).then(product => {
console.log(product); // working
})
. catch (error => {
console.log(error);
});
});
Have a look at site monitoring.
https://support.wix.com/en/corvid-by-wix/site-monitoring
https://support.wix.com/en/article/corvid-testing-and-debugging-your-code#backend-code-http-functions-1
Backend Code & HTTP Functions
Because of security concerns, messages in backend code are not logged to the browser’s console on the published version of your site.
Because HTTP functions are not browser based, messages are not logged to the console when viewing the published version of your site.
You can use Site Monitoring to view console messages in backend code and HTTP functions on the published version of your site.
Also check previous forum posts about it too.
https://www.wix.com/corvid/forum/community-discussion/console-log-in-jsw-file
Although you have just used the code from this tutorial here and it CLEARLY states and shows you what you will get returned in the console log.
https://support.wix.com/en/article/corvid-web-modules-calling-server-side-code-from-the-front-end#calling-a-function-in-a-web-module1010
Calling a Function in a Web Module
Unlike regular modules that allow you to export functions, objects, and other items, you can only export functions from web modules. Web modules also always return a promise. This is true even if, in the implementation of the function, it returns a value. For example, if your web module function returns a value, like this:
// Filename: aModule.jsw (web modules need to have a *.jsw* extension)
export function multiply(factor1, factor2) {
return factor1 * factor2;
}
When you call the function, it still returns a promise that resolves to the value. So you need to use it like this:
import {multiply} from 'backend/aModule';
multiply(4,5).then(function(product) {
console.log(product);
// Logs: 20
});
Debugging Web Modules
You can log messages to the console in web modules and they will be displayed in the client’s console log, even though the code is running server-side.