0

i am just trying to setup PWA studio at my local server and i am getting bellow error while run below command yarn run watch

yarn run watch yarn run v1.22.19 $ webpack-dev-server --progress --color --env.mode development FetchError: invalid json response body at https://venia-develop-ccewfjy-mfwmkrjfqvbjk.us-4.magentosite.cloud/graphql reason: Unexpected token A in JSON at position 0 at /var/www/html/PWA/pwa-studio-fundamentals/node_modules/@magento/pwa-buildpack/node_modules/node-fetch/lib/index.js:273:32 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async module.exports (/var/www/html/PWA/pwa-studio-fundamentals/webpack.config.js:62:29) { type: 'invalid-json' } FetchError: invalid json response body at https://venia-develop-ccewfjy-mfwmkrjfqvbjk.us-4.magentosite.cloud/graphql reason: Unexpected token A in JSON at position 0 at /var/www/html/PWA/pwa-studio-fundamentals/node_modules/@magento/pwa-buildpack/node_modules/node-fetch/lib/index.js:273:32 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async module.exports (/var/www/html/PWA/pwa-studio-fundamentals/webpack.config.js:62:29)

Could anyone help me to sortout this issue.

1
  • Same for me. Didnt find the answer. Im checking the docs and there should be a packages/.env file with config but maybe it's just after you install venia
    – Francesco
    Commented Mar 23, 2023 at 9:13

1 Answer 1

0

Found the solution. You should connect the backend with the right magento2 installation. The backend url is inside the file .env in the root directory of the pwa project.

under MAGENTO_BACKEND_URL

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.