PHome page of pwa

I have installed PWA venia in frontend magento 2.3 but images are not loading.

  • we need more information. is the image not loaded by your browser because of a 404? Commented Feb 28, 2019 at 10:42
  • @ Philipp Sander : Yes getting 404 error
    – srg
    Commented Feb 28, 2019 at 11:08
  • does the file exist? Commented Feb 28, 2019 at 11:47
  • Yes the file is there..
    – srg
    Commented Feb 28, 2019 at 11:51
  • I have a small doubt do we need to set the media path?
    – srg
    Commented Feb 28, 2019 at 11:52

6 Answers 6


I faced the same problem and was able to resolve it by creating Virtual Host (the reason why it is necessary, is to resolve the CORS erros).

You can view CORS errors when opening the 404 images in a new tab, you will get error in the console.

Create a virtual host by following all steps mentioned here. Point Virtual Host to pub directory of Magento instance.

Give that VH URL in the env file as well. This link may very help full as well.


Create a virtual host and point it to the pub directory instead of the root directory.


First create a virtual host for your magento root directory. If you are dont know how to setup virtual host please follow the link : https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts

Next you need to edit the file named "makeMediaPath.js" which is placed in the path


Now change the following line

const mediaPath = 'http://magento23.com/pub/media/catalog';

In the above line please replace "magento23.com" with your virtual host

  • Thanks a lot for providing instructions to create VH. Worked perfectly for me Commented Apr 4, 2019 at 10:32

Need to Create a Virtual Host and the DocumentRoot should not be the root directory of Magento 2 installed, instead of that add pub to that.

Before the line was




<VirtualHost *:443>
ServerAdmin [email protected]
DocumentRoot "/Users/shuvo/WebServer/MAGENTO/PWA/pub"
<Directory "/Users/shuvo/WebServer/MAGENTO/PWA/pub">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
ServerName magento-pwa.devs
ErrorLog "/Users/shuvo/WebServer/MAGENTO/Logs/magento.devs-error_log"
CustomLog "/Users/shuvo/WebServer/MAGENTO/Logs/magento.devs-access_log" common
# Example SSL configuration
SSLEngine on
SSLCertificateFile "/usr/local/etc/httpd/certs/magento-pwa.devs.pem"
SSLCertificateKeyFile "/usr/local/etc/httpd/certs/magento-pwa.devs-key.pem"

and on pwa studio .env file set MAGENTO_BACKEND_URL like this


I was facing the similar issue on localhost, tried everything but end up changing the magento entry point from root to pub directory in order to fix this issue.

Here is a cool link from devdocs on how to do it. Good Luck...



if you are using Magento 2.4 or above version, be ensure that your Elasticsearch is running , otherwise you will tackle the same problem.

To test if elasticsearch is working run below command in terminal:

sudo systemctl status elasticsearch.service

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.