Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
2 answers
77 views

How to Configure WSO2 Choreo to Serve a config.js File for Environment Variables in a Vite + React App?

I am deploying a Vite + React application on WSO2 Choreo, and I use a config.js file to define runtime environment variables like this: In my index.html, I reference this config.js file like this: &...
Kavindu Nilshan's user avatar
0 votes
0 answers
45 views

How can I read parameters from a script in VSCode powershell

I want to achieve something like this: npm run build sets environment variable BACKEND_URL to a default value of 'http://localhost:8080' and npm run build myCustomURL to set environment variable ...
Asen Asen's user avatar
0 votes
0 answers
178 views

Invalid or Unexpected Token' in env.mjs

I keep getting this error message '5173/node_modules/v…st/client/env.mjs:1 Uncaught SyntaxError: Invalid or unexpected token' in my browser when i try to run my vite application I have tried changing ...
Haruna Alvin's user avatar
0 votes
1 answer
157 views

Configuring .env files on server (react CI/CD)

I'm using react with vite and I have several .env files like .env.production, .env.qa etc with different configurations. I've read that it's not safe to push them and better to keep in .gitignore. ...
user17485084's user avatar
2 votes
1 answer
63 views

Getting the api key as undefined

The following is the component in which I am trying to make the call, it is initial state, so I was just testing the API call, but after I set up the environment variable I am getting the api key as ...
Ritwik Nandi's user avatar
1 vote
1 answer
124 views

UseEffect in infinite loop when using vite env variables [duplicate]

I have looked through the topic already discussed, but I am not finding an answer for my case anywhere. I have a function: export async function onlyMyErrorsMatter(){ try { // Simulate API call ...
Katharina Schreiber's user avatar
-1 votes
1 answer
629 views

Access VITE env variables from Azure Static Web App

I'm deploying a React/Vite app on Azure web app (the staging part) and find myself not being able to access my .env variable. I deployed a Node/Express server the same way and when I input my ...
Yohav Rn's user avatar
  • 209
0 votes
1 answer
242 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....
Mr. Emil's user avatar
0 votes
1 answer
317 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....
jrwithahoodie's user avatar
2 votes
2 answers
2k 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 ...
Gaurav's user avatar
  • 41
0 votes
0 answers
251 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 ...
JoshWarbi's user avatar
1 vote
0 answers
739 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 ...
Nikhil's user avatar
  • 121
2 votes
0 answers
7k views

Vite TypeError: Cannot read properties of undefined (reading 'VITE_YOUTUBE_API_KEY')

I'm getting this error when trying to read an Env Variable from the .env file. Things to know: my .env is in the root directory, the variable is prefixed by VITE_, and I'm trying to import it doing ...
Wasivis's user avatar
  • 91
0 votes
1 answer
250 views

.env Variables inside the compiled JavaScript?

I have a React Webapp where i placed a .env file in the root directory and inside a file i use these env variables. Now when i did npm run build, in the compiled js file these env variables are ...
user avatar
0 votes
0 answers
80 views

Uncaught ReferenceError: process is not defined using vite

i am facing this issue Uncaught ReferenceError: process is not defined at module.exports (cloudinary.js?v=2e344892:6593:34) at ../backend/node_modules/cloudinary/lib/utils/index.js (cloudinary.js?v=...
Yasir Mukhtar's user avatar

15 30 50 per page