saleor / saleor-storefront

A GraphQL-powered, NextJs-based, PWA storefront for Saleor. IMPORTANT: This project is [DEPRECATED] in favor of saleor/react-storefront soon to become our default demo and storefront starter pack.
https://demo.saleor.io/
BSD 3-Clause "New" or "Revised" License
770 stars 672 forks source link

CORS error in Heroku demo #594

Closed JesusPuga closed 4 years ago

JesusPuga commented 4 years ago

What I'm trying to achieve

Deploy saleor-storefront demo to heroku,

Steps to reproduce the problem

  1. Got to https://github.com/mirumee/saleor-storefront and click in deploy to heroku
  2. Wait until the process finish

What I expected to happen

I should be able to see the saleor-frontend from my heroku account.

Screenshots

Captura de pantalla 2020-02-05 a la(s) 17 02 05

System information Operating system: macOS Sierra Browser:Google Chrome

karolkielecki commented 4 years ago

Hello @JesusPuga. Thanks for reporting this issue. We'll investigate what's causing this error. Maybe it's something on our side.

JesusPuga commented 4 years ago

@karolkielecki Thanks :j

karolkielecki commented 4 years ago

@JesusPuga Hey there! If you would like to test it, please use this URL: https://pwa.demo.saleor.rocks/graphql/

We should change it on our side, thanks for reporting! If you have any questions or feedback, don't hesitate to contact us. You can also reach me on Gitter or Spectrum (@karolkielecki)

JesusPuga commented 4 years ago

Hi @karolkielecki , yep it worked, but just starting a new project in heroku. I tried changing de variable in my old project and it did not work, it did not recognize the new value. I tried cleaning the cache and restarting the dyno from heroku.

Example changing the variable:

Captura de pantalla 2020-02-10 a la(s) 14 56 59

Captura de pantalla 2020-02-10 a la(s) 14 49 29

Starting a new project:

Captura de pantalla 2020-02-10 a la(s) 14 57 26

So, does it mean that there is an extra process when we change our API_URL?

karolkielecki commented 4 years ago

It seems you have only set up the environment variable, but that variable should be set up before you build the storefront. You have to run the command 'npm run build', and the environment variable should direct to the new URL. That's why it works with the new dyno because the storefront has been rebuilt.