All Questions
Tagged with vite environment-variables
93
questions
0
votes
0
answers
10
views
undefined when use the env react with vite
i use react with vite and i want to use an env variable in my project. but i got undefined everytime i call the env variable. i have follow the documentation of vite and try a many solutions in ...
0
votes
0
answers
30
views
import.meta.env is undefined in a React App built with Vite. I'm unable to use environment variables [closed]
I've scoured the internet for solutions but I can't seem to find any. Here's the error I'm encountering.
TypeError: Cannot read properties of undefined (reading 'VITE_BACKEND_URL')
I can't access ...
0
votes
1
answer
44
views
nginx/vite/react config env files to server (without Docker)
I have an application on Vite React, I configured the Nginx file sites/enabled this way (I’m a newbie and this is my first time deploying)
server {
listen 80;
listen \[::\]:80;
server_name example....
0
votes
1
answer
82
views
How would you make an API call and pass data to client with Sveltekit?
I've just begun learning Sveltekit. I'm following the tutorial for Auth.js for making a custom login page (https://authjs.dev/guides/pages/signin), which passes a mapping of the providers to some ...
0
votes
0
answers
31
views
VITE is not reading .env variables prefixed with VITE_ import.meta.env in server directory. client works fine
Edit: SOLVED
In my dev environment I cannot pull environment variables in the server directory. Client env variables are imported as normal.
my folder structure is
app
|-src
|-client
|-server
....
0
votes
1
answer
81
views
Workflow not reading my GitHub Environment Secrets
I'm encountering difficulties while trying to utilize environment variables in my GitHub Actions workflow, particularly when working with Vite as my development environment for a React web application....
1
vote
0
answers
42
views
environment variables are not working on vercel, netlify
I have a .env file which contains my backend server endpoint. I have configured vite.config.js file to use that endpoint from .env file. But as I have added it on vercel for production, my project is ...
1
vote
0
answers
236
views
How to use environment variables in vite.config.js file for proxy in Vite
I am trying to access the environment variables in vite.config.js file, but there is an error while using import.meta.env.ENV_VARIABLE_NAME.
I have a vite.config.js file in which I am using proxy. The ...
1
vote
0
answers
45
views
How to access environment variables loaded using Vite defineConfig in index.html?
I know that prepending environment variables with VITE_ exposes them to Vite and they become accessible in the index.html file with %VITE_MY_VARIABLE%.
Also, what I understood from the docs is that, ...
0
votes
0
answers
68
views
VITE/React - Struggling to get environment variables to pick up my variables set in the "secrets" section of my terraform
I'm working with a React app using VITE (for the first time) and struggling to get the variables declared in my terraform (grabbed from AWS Parameter Store) to pull through. When I set the variable in ...
0
votes
0
answers
239
views
Base is set in vite.config.js but is the wrong value in import.meta.env.BASE_URL
I want to have the ability to set the base URL at build time. This is more for API calls than anything else - I don't want them going to https://localhost:7251 on production, but I also don't want to ...
0
votes
0
answers
47
views
proxy api is not working in Vite + React project when it's deployed to Vercel
I have an issue with Vite+React project.
I used Vite proxy to fetch data via api and it's working well in local.
But 401 error is caused when it's deployed to Vercel.com.
Vite configuration is like ...
0
votes
1
answer
304
views
Vite not loading values defined in .env
Context: Using React/Typescript/Vite/Yarn
I have a project where I am defining my backend URL in my .env file to use as a constant throughout my project. However, it's not being recognized at the top ...
0
votes
0
answers
118
views
Environment variables in Vite React during runtime
I am using Vite setup for my react application. Although I am using the environment variables in workflows file as docker arguments like this while building the image -
docker-args: "--build-arg ...
-1
votes
1
answer
117
views
Env variables are not working in Vue 3 with Vite and Typescript
Variables of environment (env) just not working in the App Vue 3 with Vite and Typescript.
I tried a lot of advices and nothing works.