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

122
Vistas
Nuxt image keeps breaking on page change

I have image displayed on my Nuxt page but anytime I navigate away from it back the image breaks and I do not know why.

I have this in my code

<img :src="baseUrl + 'storage/'+ front.featured_image" alt="post-title" />

and my script

data: () => ({
  frontpage: [],
    baseUrl: process.env.BASE_URL
}),
async asyncData({ $axios }) {
  const response = await $axios.get('/api/frontpage')
  return { frontpage: response.data.posts }
},

I have a .env file and I have the following inside it BASE_URL=http://localhost/ and I also have the following inside nuxt.config.js

env:{
  baseUrl: process.env.BASE_URL || 'http://localhost/'
}

My API is built using laravel and it is loading from http://localhost/ but Nuxt keeps going back to localhost:3000 on page change.

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

0

You can check my previous answer here: https://stackoverflow.com/a/67705541/8816585

This may help

export default {
  publicRuntimeConfig: {
    baseUrl: process.env.BASE_URL,
  },
}

Otherwise, this configuration of Axios may also help!

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