Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

194
Vistas
env variables are not accessible in nextjs 11.1

I"m using nextjs 11.1 and I have 2 files env.development and .env.production. Below are the contents they have.

.env.development
NEXT_PUBLIC_API_ENDPOINT=http://localhost:3000/api/

And

.env.production
NEXT_PUBLIC_API_ENDPOINT=https://production.com/api/

Inside my index.tsx I am trying to access these variables but .env is empty.

const Home = () => {
    console.log('process.env: ', process.env); // this returns empty object {}.

  return (
    <>
        HOME
    </>
  )
}

export default Home;

Where am I making mistake and how can I access these variables?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda