I have a backend web module (back1.jsw) and it has a simple function like the following:
export function createContact(email, name) {
return wixCrmBackend.createContact({
"firstName": name,
"lastName": '',
"emails": [email],
"phones": []
}).then(id => { return id });
}
Then I call this function from a client-side code like the following:
import { createContact } from 'backend/backs';
export function SbmtBtn_click(event) {
return createContact( $w('#emailBox').value, $w('#nameBox').value).then(rslt => {
console.log('sent ' + rslt);
});
}
I have no code errors, but when publishing and opening the published site, I got ‘Uncaught’ error.
But if I moved the backend function to the client-side code it runs.
Till yesterday everything was working, but now I don’t know what is the problem?
Any responses will be highly appreciated.