magento / pwa-studio

🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.
https://developer.adobe.com/commerce/pwa-studio/
Open Software License 3.0
1.07k stars 683 forks source link

CMS Pages don't render #1002

Closed rossmc closed 5 years ago

rossmc commented 5 years ago

Describe the bug CMS Pages don't render when I try to navigate to a URL for a CMS Page on the Venia storefront.

To Reproduce Steps to reproduce the behavior:

  1. Go to '/privacy-policy-cookie-restriction-mode' on Venia Storefront
  2. See error ENOENT: no such file or directory, stat '/Users/ross/Projects/pwa-temp/packages/venia-concept/dist/privacy-policy-cookie-restriction-mode'

Update If you add .html to the end of the URL, you get a different error in the browser console:

Screenshot 2019-03-26 at 11 09 33

Expected behavior The CMS Page to load with it's content set in the Magento Admin Panel.

Screenshots https://user-images.githubusercontent.com/2452991/54025192-14213380-419a-11e9-907f-862a9eef0854.png

Please complete the following device information:

Please let us know what packages this bug is in regards to:

Additional context

Possible solutions The GraphQL query works when I test it in a GraphiQl... screenshot 2019-03-08 at 12 05 37

danrcoull commented 5 years ago

1029 See the pull request, here i had the same issue but this is how i got arround the issue

rossmc commented 5 years ago

Thanks @danrcoull, but when I applied the changes from your PR I still get the same errors when I browser to either

Can you browser to those URLs on your local?

danrcoull commented 5 years ago

does the cms page with that url key exist in magento ?

rossmc commented 5 years ago

Yes, that URL exists out-of-the-box on all M2 instances. I also double checked it exists with GraphiQL.

{
  urlResolver(url: "/privacy-policy-cookie-restriction-mode") {
    type
    id
  }
}

Use this public endpoint used by PWA Studio: https://release-dev-231-npzdaky-zddsyhrdimyra.us-4.magentosite.cloud/graphql

The GraphQL response is:

{
  "data": {
    "urlResolver": {
      "type": "CMS_PAGE",
      "id": 4
    }
  }
}
awilcoxa commented 5 years ago

This isn't a bug but a feature request for pulling in CMS content from Magento backend, currently a gap. closing this as a defect and will track through a feature request.