-
Notifications
You must be signed in to change notification settings - Fork 219
Product Title, Product Stock, Product Summary don't load in the frontend when added alone #5597
Comments
Mentioned blocks are atomic Product Element blocks, and we have couple more of those than the ones listed here. So far we did not expose any of the atomic Product Element blocks as standalone webpack entry points. Should we expose all of them? I can see how it might be nice to build completely custom landing pages using this or sky is the limit really! But we should make a call if we want to expose all elements as entry points, if not all should be exposed have clear conditions what should be exposed or make it not possible to insert atomic elements outside of parent blocks that support them. To expose them we need to add them to the
Most of those blocks don't implement This is as far as I made it. The question is - should atomic blocks have ability to be rendered as stand-alone blocks and if so - are they still atomic components? Should we then implement frotnend variant for all of those components? This worked in editor because in editor edit variant was used not frontend one. |
Thanks for the research @tomasztunik!
I think the initial intention was to make those blocks available standalone, so it wouldn't be required to add them inside one of their parents. But yes, it looks like the issue is not only with the three blocks I reported, but with all atomic blocks. There still seems to be something different in those three blocks because I get a 404 requests when they are in a post or page and I don't get the same errors with other atomic blocks (ie: Product Price). In any case, and given that these blocks are available as standalone blocks only in dev builds, it's probably low priority issue. 👍 |
@Aljullu this is because when block is lazy fetched it expects the If you look into atomic components folders you'll see that a lot of them don't have it. |
Right, none of the atomic blocks renders in the frontend if added standalone, but the 404 error only happens in three of them. Ie: if you add the Product Price block to a post or page and visit the frontend, you won't see any 404 requests even though it doesn't have a I didn't do much research, but might it be related with the fact that we register ProductTitle, ProductSummary and ProductStockIndicator in the PHP side? They inherit from the In any case, that's very low priority because those blocks are only available in dev builds and we don't know if they will ever be available in production as standalone blocks. 🙂 |
This is partially fixed by #5989 - when requested the blocks will have its code properly loaded on demand. |
This issue has been marked as Internal: After 10 days with no activity this issue will be automatically be closed. |
I'm going to close this issue, as the future way to use these blocks is inside the Single Product block (#8610). |
To reproduce
404 GET .../wp-content/plugins/woocommerce-gutenberg-products-block/build/product-title-frontend.js
Expected behavior
The block should load correctly and there shouldn't be a 404 error.
The text was updated successfully, but these errors were encountered: