Wix-Ecom-Backend error

Hey, I’m getting this error when I try to do anything with Wix-Ecom-Backend “Current Cart”.

This is happening after I try to console.log the results of any request. For example my code is:

export async function getThisCart() {
let cart = await currentCart.getCurrentCart();
return cart;
}

I’ll get the error in the picture below.

Just for ref, I’m coding in the backend ofc with a JSW file and I have the import statement:

import { currentCart } from ‘wix-ecom-backend’ ;

The reference says I don’t need an ID to use anything in Backend Econ so I’m really confused. Building for a client so if you have any idea and can help please let me know.

Thanks! :hugs:

How are you triggering the call to this function? From the FE of your published site? I’m fairly certain these functions will not work as expected in preview

Well, it seems as though once I run it in a test/live site it recalls the information I need but it doesn’t work in preview and it throws the error on the live site console even though it still recalls the information. So I’m gonna work with it since it’s not affecting usability of the actual website.

1 Like

Glad it’s working even if that’s a but unusual. If you do encounter a bug that is affecting your site, the best way to report is via customer care. Here’s one link, and you can also report bugs via the editor https://support.wix.com/en/article/contacting-wix-customer-care-for-support

1 Like