Shopware 6: bin/watch-storefront.sh causes CORS errors in chrome

Viewed 509

When trying to develop the store front, we use bin/watch-storefront.sh

Our APP URL is http://ourshop.localhost.example.com and we have a DNS entry which points to 127.0.0.1

Now when opening the printed URL http://ourshop.localhost.example.com:9998 most of the AJAX requests do not work due to CORS errors.

This seems because the site now running at URL http://ourshop.localhost.example.com:9998 is requesting data from http://ourshop.localhost.example.com (for example when paginating throw the product filters / list.

We already tried changing the APP_URL to http://ourshop.localhost.example.com:9998 but it does not help.

How can this be solved?

EDIT

The interesting part is, that bin/watch-administration.sh does not suffer from this problems. It servers on http://localhost:8080/ and works without CORS problems.

1 Answers

One workaround would be to call Chrome with CORS disabled

google-chrome --disable-web-security --user-data-dir=/tmp/user$$

But I am looking for better solutions.

Related