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

865
Vistas
How to access public directory images when the app is in .next folder in nextjs?

After building my next application by running npm run build, all the images in the public folder are being stored as static images which I believe is how it is expected to work. However, I want to access the images in the public directory from the .next folder as I am adding new images to it every time.

Here is the folder structure

If it requires any change to happen in the folder structure like moving the public folder to any other location or making a new directory, it would still be fine.

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

0

Here you can find your solution in NextJs docs: https://nextjs.org/docs/basic-features/static-file-serving

"Next.js can serve static files, like images, under a folder called public in the root directory. Files inside public can then be referenced by your code starting from the base URL (/).

For example, if you add an image to public/me.png, the following code will access the image:

import Image from 'next/image'

function Avatar() {
  return <Image src="/me.png" alt="me" width="64" height="64" />
}

export default Avatar

Note: next/image requires Next.js 10 or later.

"

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