Hi, Im not sure what is the problem, but I have my own package in Wix Blocks, the code is working if i put it normally to backend files, but if I move it to the package, it doesnt work.
I did some experiments and even if i strip all code exept imports and logging, the code doesnt work.
Meaning this is the result and even this doesn’t work. I test it by editing of the product, which should log “onProductUpdated fired”. It doesn’t do anything.
And once again: if I even uncomment all the code and put it to events.js in backend scripts, everything is working fine. Just if I go the installed package way, it doesn’t work even with this barebone version…
Is there any caveat to look for? I build the version, install update, publish website, make product edit and nothing happens (i look at both logging panel in administration and I have Google Operations linked and working)
/* backend: events.js */
import wixStoresBackend from 'wix-stores-backend';
import wixData from 'wix-data';
import {getSecret} from 'wix-secrets-backend';
import {fetch} from 'wix-fetch';
import convert from 'xml-js';
export async function wixStores_onProductUpdated(event) {
console.log('onProductUpdated fired');
}
export async function wixStores_onNewOrder(event) {
console.log('onNewOrder fired');
/*
commented code
*/
}
export async function wixStores_onOrderPaid(event) {
console.log('onOrderPaid fired');
/*
commented code
*/
}