Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
next/image fails to work when converting project from JavaScript to TypeScript

I'm working on converting my personal website from a Next.js JavaScript to TypeScript project. Previously I had a placeholder background image loaded with the next/image system:

<Image
    src="/filename.jpg"
    layout="fill"
    objectFit="cover"
    quality={100}
/>

I am not using a loader at the moment. This successfully loaded, if a bit slow. I moved to TypeScript with no changes to that line or related lines, but am now getting a 502 (Bad Gateway) error when attempting to load the image.

If I modify the URL to a nonexistent file like "/falename.jpg" then I instead get a 400 (Bad Request) error. That seems to indicate that the file access is fine, but it's somehow not loading correctly in TypeScript only.

Is there some setup step that I am missing? I've combed through all of Next.js's next/image and TypeScript guides and haven't noticed anything of the sort.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Turns out the transition to TypeScript put some sort of cap on image file size; I tried using lower resolution images and that worked.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda