Current vs Expected Behavior:
I’m deploying a chatbot project on Vercel that uses API keys stored in environment variables (specifically MISTRAL_API_KEY). When I run the project locally using a .env file, everything works perfectly, and the API key is accessed correctly. However, after deploying it on Vercel, the environment variables are not being accessed as expected, causing API calls to fail.
I’ve added the environment variables to the Vercel dashboard under Project Settings > Environment Variables, but my code still seems to be unable to access them after redeployment.
Code, Configuration, and Steps to Reproduce:
Locally, I’m using a .env file and accessing environment variables like this:
const apiKey = process.env.MISTRAL_API_KEY;
On Vercel, I set the MISTRAL_API_KEY in Environment Variables for the correct environment (Production) and redeployed the project.
Despite this, the key is undefined during runtime on Vercel.The Tech stack for this project is html,css and js