Product comparison page displaying console error "error in dispatch"

I followed all vtex.product-comparison config steps and search page, category page, product page and bucket area for products to compare are working fine. Just only the product-comparison page is not working (blank page), giving me console error error in dispatch {args: {…}, type: 'SET_SHOW_DIFFERENCES'}. I created a “store.custom#product-comparison-list” block following this step and the properly route to product-comparison.

I’ve already reviewed all the settings and I’m trying to debug through app link, which I cloned in the version I’m using.

I think some undocumented step is missing.

Hi @tiago.freire, welcome to VTEX Community!

Just to confirm what you are reporting, the issue is that you /product-comparison page is not being rendered due to the error you shared, correct? So, for example, after adding products for comparison from pages like search, the product comparison page is still blank?

Later I’ll try to follow the instructions in the documentation in my test store to see if I can replicate, but are you already seeing the “Compare” button (product-comparison-block.selector#pdp) in your shelves/PDPs? Do you also see the comparison drawer (product-comparison-drawer) appear in the bottom of your store when navigating?

Nice to see another Brazilian here :slight_smile:

Yes, the page in route /product-comparison is not being rendered, even when I add product for comparison. The “compare” button is being displayed in the shelves/PDPs, and the comparison drawer is also being displayed in the bottom of the screen during navigation.

Additionally, I see a PRODUCTS_TO_COMPARE key in my browser’s local storage in the format [{"productId":"xx","skuId":"yy"}...] containing the products I chose.

The only thing I’m really missing is the /product-comparison page, where the main content is empty. The header and footer are rendered as expected.

1 Like

Good evening, George!

Did you get to replicate the scenario, following the same instructions in documentation?

Thanks in advance!

Not yet, unfortunately… But I’ll let you know as soon as I get the chance.

1 Like

I found out I hadn’t declared the comparison-page block as a descendant of store.custom#product-comparison-list! Looks like a silly detail, but I strictly followed the configuration described at steps 5 & 6 and this detail had not been clear for me. Thanks for your attention, George!

1 Like

Thanks for sharing the answer back to the community so we could all learn from it. Glad to see you were able to figure it out!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.