vendure-ecommerce / storefront-qwik-starter

An e-commerce storefront starter built with Qwik and Vendure
https://qwik-storefront.vendure.io
227 stars 86 forks source link

Local Vendure API URL Not Recognized in Development Mode #161

Closed yohamta closed 1 month ago

yohamta commented 2 months ago

Description: I am trying to run the Vendure Qwik storefront locally and connect it to my local Vendure server. However, despite setting the environment variable for the API URL in the .env file, the application continues to connect to the demo API at https://readonlydemo.vendure.io/shop-api.

Steps to Reproduce:

  1. Clone the repository: git clone https://github.com/vendure-ecommerce/storefront-qwik-starter.git
  2. Navigate to the project directory: cd storefront-qwik-starter
  3. Create a .env file with the following content:
    VITE_IS_LOCAL=true
    VITE_VENDURE_PUBLIC_URL=http://localhost:3000/shop-api
    VITE_VENDURE_LOCAL_URL=http://localhost:3000/shop-api
    VITE_VENDURE_API_URL=http://localhost:3000/shop-api
    VITE_VENDURE_CHANNEL_TOKEN=default_channel
  4. Run the development server: npm run dev
  5. Observe that the application http://localhost:8080/ connects to the demo API instead of my local Vendure server.

Expected Behavior: The application should connect to the local Vendure server as specified in the .env file.

Actual Behavior: The application continues to connect to https://readonlydemo.vendure.io/shop-api.

Additional Information:

Environment:

Please let me know if there are any additional steps I should take or if there is a known issue with environment variable handling in the current setup. Thank you!

gioboa commented 2 months ago

You did the right steps but at the moment the application is using these constants We should switch and use the environment variables. A PR is more than welcome.