michaelolajide027 / faster

https://faster-neon.vercel.app
0 stars 1 forks source link

API_BASE_URL Not Reflecting on Cloud Deployment #3

Open Sanni-Damilola opened 1 month ago

Sanni-Damilola commented 1 month ago

Description: The API_BASE_URL environment variable is not being reflected when deploying to Vercel. This issue occurs because the environment variables have not been set on the Vercel server.

Steps to Reproduce:

  1. Deploy the application to Vercel.
  2. Attempt to access any feature that relies on the API_BASE_URL environment variable.
  3. Observe that the application fails to fetch data from the API, indicating that the API_BASE_URL is not set.

Expected Behavior: The application should correctly use the API_BASE_URL environment variable and successfully fetch data from the API when deployed to Vercel.

Actual Behavior: The application fails to fetch data from the API, suggesting that the API_BASE_URL environment variable is not set on the Vercel server.

Solution: To resolve this issue, add the necessary environment variables on the Vercel server. Here’s how to set environment variables for Vercel:

For Vercel:

  1. Log in to your Vercel account and navigate to your project.
  2. Go to the "Settings" tab.
  3. In the "Environment Variables" section, click "Add".
  4. Add a new key-value pair:
    • Key: API_BASE_URL
    • Value: the code in env.js
  5. Click the "Save" button.

Steps to Set Environment Variables on Vercel:

  1. Navigate to the Vercel dashboard and select your project.
  2. Click on the "Settings" tab in the left sidebar.
  3. Scroll down to the "Environment Variables" section.
  4. Click on the "Add" button to add a new environment variable.
  5. Enter API_BASE_URL as the key and the code in env.js as the value.
  6. Click the "Save" button to save the environment variable.

After setting the environment variables on Vercel, redeploy your application to ensure the changes take effect.

Additional Information:

michaelolajide027 commented 1 month ago

Description: The API_BASE_URL environment variable is not being reflected when deploying to Vercel. This issue occurs because the environment variables have not been set on the Vercel server.

Steps to Reproduce:

  1. Deploy the application to Vercel.
  2. Attempt to access any feature that relies on the API_BASE_URL environment variable.
  3. Observe that the application fails to fetch data from the API, indicating that the API_BASE_URL is not set.

Expected Behavior: The application should correctly use the API_BASE_URL environment variable and successfully fetch data from the API when deployed to Vercel.

Actual Behavior: The application fails to fetch data from the API, suggesting that the API_BASE_URL environment variable is not set on the Vercel server.

Solution: To resolve this issue, add the necessary environment variables on the Vercel server. Here’s how to set environment variables for Vercel:

For Vercel:

  1. Log in to your Vercel account and navigate to your project.
  2. Go to the "Settings" tab.
  3. In the "Environment Variables" section, click "Add".
  4. Add a new key-value pair:

    • Key: API_BASE_URL
    • Value: the code in env.js
  5. Click the "Save" button.

Steps to Set Environment Variables on Vercel:

  1. Navigate to the Vercel dashboard and select your project.
  2. Click on the "Settings" tab in the left sidebar.
  3. Scroll down to the "Environment Variables" section.
  4. Click on the "Add" button to add a new environment variable.
  5. Enter API_BASE_URL as the key and the code in env.js as the value.
  6. Click the "Save" button to save the environment variable.

After setting the environment variables on Vercel, redeploy your application to ensure the changes take effect.

Additional Information:

  • Ensure that the API_BASE_URL is correctly defined in your .env file for local development.
  • Verify that there are no typos in the key names when setting environment variables on Vercel.

🗒