Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort.js:6 Uncaught TypeError: Cannot destructure property 'filter_products' of '(0 , _context_filter_context__WEBPACK_IMPORTED_MODULE_1__.useFilterContext)(...)' as it is undefined. #20

Open
ashishb1991 opened this issue Feb 3, 2023 · 3 comments

Comments

@ashishb1991
Copy link

Sort.js:6 Uncaught TypeError: Cannot destructure property 'filter_products' of '(0 , context_filter_context__WEBPACK_IMPORTED_MODULE_1_.useFilterContext)(...)' as it is undefined.

@marufk21
Copy link

can u solved this error?

@shrutidoneria123
Copy link

can anyone solve this issue?

@raghub-github
Copy link

error part***

// const getLocalCartData = () => {
// let localCartData = localStorage.getItem("userCartData");
// if (localCartData === []) {
// return [];
// } else {
// return JSON.parse(localCartData);
// }
// };

** Fixed the error
let getLocalCartData = JSON.parse(localStorage.getItem('userCartData')) ? JSON.parse(localStorage.getItem('userCartData')) : [];

const initialState = {
cart: getLocalCartData,
total_item: "",
total_price: "",
shipping_fee: 5000,
};

** Replace it from cart_context.js file to fix it,,, it should works.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants