-
Notifications
You must be signed in to change notification settings - Fork 685
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
Product detail page rendering issue #352
Comments
@Starotitorov This should theoretically never happen, because the product detail query should never run unless Your HAR file shows that your browser posted the following GraphQL query on line 75:
Your Magento instance's response is visible on line 140:
You can see that the So the PWA loads the Product RootComponent, and executes the query in line 584 of your HAR:
If Magento's urlResolver says that
I have to conclude that this is a malfunction in your particular Magento instance, unless you can produce a minimal reproducible case on another instance. If you do, please reopen! |
This issue is for the following packages:
[x]
venia-concept
[ ]
pwa-buildpack
[ ]
peregrine
[ ]
pwa-module
[ ]
pwa-devdocs
[ ]
upward-js
[ ]
upward-spec
This issue is a:
[x] Bug
[ ] Feature suggestion
[ ] Documentation issue
[ ] Other (Please Specify)
Environment
node -v
)npm -v
)Description
I installed venia sample data. When I open category page and click on a product item, the application navigates me to the product detail page, GraphQL query returns empty array of items and rendering of the page fails because of this line https://github.com/magento-research/pwa-studio/blob/release/2.0/packages/venia-concept/src/RootComponents/Product/Product.js#L71 .
GraphQL request payload:
{"operationName":"productDetail","variables":{"urlKey":"silver-sol-earrings","onServer":false},"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: {url_key: {eq: $urlKey}}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n __typename\n }\n __typename\n }\n __typename\n }\n description\n media_gallery_entries {\n label\n position\n disabled\n file\n __typename\n }\n meta_title @include(if: $onServer)\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n __typename\n }\n __typename\n }\n}\n"}
Response:
{"data":{"productDetail":{"items":[],"__typename":"Products"}}}
HAR:
magento-venia-concept-djt-z.local.pwadev.zip
Expected result:
Product detail page renders correctly. GraphQL query should return items.
Possible solutions:
Start checking if array of items is empty, correct this line https://github.com/magento-research/pwa-studio/blob/release/2.0/packages/venia-concept/src/RootComponents/Product/Product.js#L71 .
The text was updated successfully, but these errors were encountered: