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

191
Vistas
ServerRuntimeConfig is empty

I am working on my nextjs project under docker, and when using getStaticProps my backend api is not available(which is also under docker). So I connected frontend to backend via networks and if i hardcode api for ssr request it works. But when i try to utilize serverRuntimeConfig and publicRuntimeConfig so i could switch between them depending on where code is being ran I get {} for serverRuntimeConfig. However publicRuntimeConfig is fine and i can access api from it. My next.config.js is:

module.exports = {
    publicRuntimeConfig: {
        // Will be available on both server and client
        baseUrl: 'http://localhost/api/v1',
    },
    serverRuntimeConfig: {
        // Will only be available on the server side
        baseUrl: 'http://backend_nginx_1/api/v1/',
    },

am I missing something ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This will sound dumb, but I spent 2 hours seeing the empty file been recognized by the system and just seeing {}. Now... restarting the server, gives you access to the content of the file. That was my solution.

And it was not included in the documentation.

https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration

about 4 years ago · Juan Pablo Isaza Denunciar
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