1

I am trying to setup PWA for my local dev server hostname as http://dev-test/

Referencing for this link here:https://webkul.com/blog/magento2-3-pwa-studio-setup/

when I run build I get the following error: sudo yarn run build:dev

yarn run v1.22.0
$ yarn venia run build:dev
$ node ./packages/pwa-buildpack/bin/buildpack load-env ./packages/venia-concept && yarn workspace @magento/venia-concept run build:dev
  ⚠  Default value for CHECKOUT_BRAINTREE_TOKEN has changed in PWA Studio Buildpack v5.0.0, due to
     confusion about whether developers should provide their own Braintree tokens for their own sites. An
     example value is provided instead for development purposes.
     Old value: sandbox_8yrzsvtm_s2bg8fs563crhqzk
     New value: undefined
     This project is using the old default value for CHECKOUT_BRAINTREE_TOKEN. Check to make sure the change
     does not cause regressions.
$ yarn run clean && yarn run validate-queries && webpack --no-progress --env.mode development
$ rimraf dist
$ yarn run download-schema && graphql validate-magento-pwa-queries --project venia
$ graphql get-schema --project venia --insecure
project venia - Schema file was created: lastCachedGraphQLSchema.json
Validating GraphQL queries in venia project...
✔ Locating schema...
✔ Finding queries in files...
✔ Validating project's queries against the schema...

Found some potential issues:

/var/www/mag-pwa/pwa-studio/packages/venia-ui/lib/components/CartPage/GiftCards/giftCardFragments.ee.js
  5:9  error  Cannot query field "applied_gift_cards" on type "Cart". Did you mean "applied_coupons"?  graphql/template-strings

/var/www/mag-pwa/pwa-studio/packages/venia-ui/lib/components/CartPage/GiftCards/giftCardQueries.js
  18:9  error  Cannot query field "giftCardAccount" on type "Query"                                                                          graphql/template-strings
  32:9  error  Cannot query field "applyGiftCardToCart" on type "Mutation". Did you mean "applyCouponToCart"?                                graphql/template-strings
  46:9  error  Cannot query field "removeGiftCardFromCart" on type "Mutation". Did you mean "removeItemFromCart" or "removeCouponFromCart"?  graphql/template-strings

/var/www/mag-pwa/pwa-studio/packages/venia-ui/lib/components/CartPage/PriceSummary/queries/giftCardSummary.ee.js
  6:9  error  Cannot query field "applied_gift_cards" on type "Cart". Did you mean "applied_coupons"?  graphql/template-strings

I am aslo getting some warning but I suposed this should be ok to build and some incompatibilities issue can't be right I am using 2.3.4:

Your versions of PWA and Magento may be incompatible.

This Venia store is from PWA Studio version 5.0.1. Some components in PWA Studio version 5.0.1 send GraphQL queries that are only compatible with version 2.3.3 - 2.3.4 of Magento 2.

Please refer to the compatibility table in the PWA documentation for more details: https://pwastudio.io/technologies/magento-compatibility/.

Has anyone any idea what could be the issue?

2
  • Have you tried following the installation instructions from Magento? The article you followed is pretty out of date now.
    – Ben Crook
    Mar 2, 2020 at 14:25
  • @BenCrook yes I if use the BACKEND URL master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud it works ok but I need tyo my obviously, I am currently trying to setup on an exiting 2.3.4 wiht sample data installed. I am now facing other errors. Mar 2, 2020 at 15:10

1 Answer 1

1

The error indicated that the source code of your Storefront was not compatible with your M2 backend. You need to check the configuration file of the 'venia-concept' (at .../packages/venia-concept/.env) to see if your M2 backend was the one that Magento provided https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud or another one specified in your local instance.

If you're using a local M2 backend, make sure it works fine with https.

Meanwhile, we wonder if you have tried using the command @magento/create-pwa (first introduced in PWA Studio 5.0.0)? It's way easier to create a custom PWA project on top of Magento PWA Studio this way.

PS. We have put together a simple guide to set up a magento PWA Studio project using the above-mentioned command here (We did test with both PWA Studio 5.0.0 and 5.0.1)

Hope it helps.

Regards, Ubertheme team

3
  • 1
    thanks for your input it doesn't work when I run yarn run build:dev but it works when run yarn run build && yarn run stage:venia Which I have followed the doc ref: magento.github.io/pwa-studio/venia-pwa-concept/setup I am finally able to run on my localhost domain dev-test but with sample data from magento not venia which I've already had it installed. Mar 3, 2020 at 11:10
  • 1
    The 'yarn run build:dev' actually refers to 'yarn run clean && yarn run validate-queries && webpack --no-progress --env.mode development' which includes the validation process ('yarn run validate-queries') to identify any incompatibility issue. Your error notice referred to the issue w/ the 'CartPage', latest element in PWA studio 'develop' branch which its associated GraphQL endpoints weren't released in M2.3.4 yet. That's the root cause of the issue when installing your own M2.3.4 backend w/ the latest PWA Studio develop branch.
    – Ubertheme
    Mar 4, 2020 at 8:36
  • If you still want to deploy the PWA Studio develop branch without such issue, you need to use default backend provided by Magento instead: master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud Anyway, it's better to pull specific PWA Studio 5.0.1 or 5.0.0, instead of PWA Studio's 'develop' branch. This will ensure the best compatibility with your own Magento 2.3.4 backend.
    – Ubertheme
    Mar 4, 2020 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.