PWA Studio: Validation errors when running developer mode

This topic discusses a solution for when validation errors occur when running developer mode in Progressive Web App (PWA) Studio for Adobe Commerce as a result of not previously creating the venia-concept (Venia is a PWA storefront.) environment file. This file will hold the variables for your local development environment.

Affected products and versions

  • PWA Studio for Adobe Commerce

Issue

Step to reproduce:

  • Run developer mode in PWA Studio for Adobe Commerce.

Expected result:

  • The PWA Studio server starts normally.

Actual result:

  • You see validation errors, which may look similar to:
    ⓧ  Missing required environment variables:         MAGENTO_BACKEND_URL: Connect to an instance of Adobe Commerce 2.3 by specifying its public domain name. (eg.         "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/")      ⚠  No .env file in ./packages/venia-concept. Autogenerate a .env file by running the command 'buildpack         create-env-file ./packages/venia-concept'.

Cause

The environment variables file for your local development environment is missing. The file that the below command generates will hold the variables for your local development environment.

Solution

Make sure that you run the command

npx @magento/pwa-buildpack create-env-file packages/venia-concept

in the root directory in order to generate the file that will hold the variables for your local development environment.

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a