2

I have installed pwa-studio by following magento pwa docs. Now when I try to run command "yarn run watch" got below error

$ webpack-dev-server --progress --color --env.mode development
As of version 12.1.0, PWA Studio requires the appropriate PWA metapackage to be installed on the backend.
For more information, refer to the 12.1.0 release notes here: https://github.com/magento/pwa-studio/releases/tag/v12.1.0
Error: Cannot query field "newsletter_enabled" on type "StoreConfig". (... 1 errors total)
    at /var/www/vhosts/mysite.com/htdocs/pwa-studio/node_modules/@magento/pwa-buildpack/lib/Utilities/graphQL.js:54:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async module.exports (/var/www/vhosts/mysite.com/htdocs/pwa-studio/webpack.config.js:62:29)

I already installed metapackage still this issue happening. Does anyone have any idea how to solve this?

Magento version: 2.4.1

Php: 7.3

5
  • did you find the solution for this? Commented Apr 7, 2022 at 7:52
  • 1
    Not actually. I ended up using Magento 2.4.3 and php version 7.4 and that solved the issue.
    – Nayem323
    Commented Apr 28, 2022 at 9:12
  • I have cloned my cloud magento in my localhost. So do I need to give my cloud instance URL or my local URL in the .env file? Commented Mar 30, 2023 at 5:06
  • @biplabrout whichever you want to use as your backend.
    – Nayem323
    Commented Mar 30, 2023 at 7:05
  • In PWA I am using product recommendations. But environment id, store view code are empty. Any reason ? Commented Mar 31, 2023 at 10:42

3 Answers 3

1

Run the below command in Magento root which is defined in the .env file of the PWA setup

composer require magento/pwa

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy -f
0

I have found a RCA and updated the configuration accordingly and an issue got resolved.

Actually Magento looking the newsletter_enabled value from the core_config_data table (newsletter/general/active). If the entry does not exist in the table then we will face the above issue.

enter image description here

So simply go to Stores > Configuration > Customers > Newsletter enable/disable the configuration once and make sure the above entry added in the core_config_data table. That's It.

enter image description here

enter image description here

0

Your magento vendor newsletter graphql module schema.graphqls file
vendor/magento/module-newsletter-graph-ql/etc/schema.graphqls

not having StoreConfig graphql

type StoreConfig @doc(description: "NewsletterGraphQl Enable Disable") {
newsletter_enabled: Boolean

}

If you add this in graphql newsletter module your issue will resolved

Your Answer

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

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