Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
process.env variables always undefined, works perfectly fine in other project

Project A (working):

cy.request(`${Cypress.env('mainnet')}api?module=account&action=txlist&address=${ethWallet}&startblock=0&endblock=99999999&page=1&offset=10&sort=asc&apikey=${process.env.apiKey}`).then((response) => {

.env File:

apiKey=YOUR_KEY_HERE

Project B (not working):

const key = process.env.apiKey
const token = process.env.authToken

Cypress.Commands.add('createBoard', (name) => {
    cy
      .request('POST', 'boards', { name, key: process.env.apiKey, token: process.env.authToken })
      .then(({ body }) => {
        Cypress.env('boards').push(body)
      })
  })

.env File:

apiKey=MY_KEY
authToken=MY_TOKEN

Both projects have the same packages and a correct .env file setup. So why in project B do I keep getting undefined? It makes no sense at all.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!