Oh, goodness, way, way too much code. And, I’m worried that the infrastructure cannot handle the project. Granted, I am very new to this, so I know there’s many ways for me to yet lighten the load through backend modules and public files. I have started to do that and can continue down that road, but with this recent issue, I’m starting to despair and thinking that no amount of tweaking will fix this as my project requires more than wix can handle…(please tell me I’m wrong!
However, it may still be my messy code that had a hand in it (which leaves hope as that could be remedied.)
These errors started creeping in as I started my custom store pages about 10 days ago. At first, many “PlatformError: rejected handling callbacks from stale contexts.” I couldn’t find much on these errors, and since they weren’t effecting the functionality, I let them slide.
Then the "Ambassador client request failed: http status: 404"s started. These had something to do with my attempt to create my own cart icon through code on the master page. It seemed that these errors had something to do with empty carts, and I am happy to share that code (as it’s short), and I know it’s off. (it needs some sort of error catch and something to deal with the scenario of empty carts.) Here’s that code:
import { cart } from 'wix-stores'
$w.onReady(function () {
cart.getCurrentCart()
.then((currentCart) => {
const cartLineItems = currentCart.lineItems.length;
$w('#cartCount').text = cartLineItems.toString();
});
cart.onChange((changedCart) => {
const cartLineItems = changedCart.lineItems.length;
$w('#cartCount').text = cartLineItems.toString();
cart.hideMiniCart();
});
});
//close minicart(not yet implemented)
//$w('#closeCartStrip').onClick((event) => {
// $w('#columnStrip28').hide();
// $w('#wixChat1').show();
// });
But, as that error also was not messing with the functionality, I was plowing ahead with my store pages (thinking to go back to the master page/mini cart stuff next.
Then, last night, the “failure to import scripts” errors started, which have rendered the site useless. I have no idea if this new issue is related to the master page. The code on my store pages is raw, heavy, and I have not yet created any backend or public files to increase efficiency. (there’s plenty of redundancy in it and stupid/amateurish ways of dealing with the json stuff.) I’d love to share that code as well, if you’re up for it! Caveat: it’s 750 lines long!
Thank you so much for responding! Any advice at this point is welcome!!
All the best,
Nicky
(Centgraf Farms)