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

194
Visualizações
Astro is trying to load a js layout instead of an astro

I was following the instructions to have markdown content with Astro.

So I created a layout file src/layout/markdown.astro with

---
const { content } = Astro.props;
---
<html>
<head>
    <title>{content.title}</title>
</head>
<body>
    <slot />
</body>
</html>

And the page file src/pages/blog/test.md with

---
layout: ../../layout/markdown.astro
title: Test
---
# Hello world

But for some reason astro is trying to find the markdown.astro.js file instead:

[executing astro] CompileError: Could not find "/src/layouts/markdown.astro.js"
    at load (file:///Users/me/Workspace/my-project/node_modules/astro/dist/runtime.js:177:16)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Server.<anonymous> (file:///Users/me/Workspace/my-project/node_modules/astro/dist/dev.js:21:20) {
  start: { line: 1, column: 0, character: 0 },
  end: undefined,
  filename: '/Users/me/Workspace/my-project/blog/test/index.html',
  frame: '1: \n   ^'
}

My astro.config.mjs is pretty much emtpy:

// @type-check enabled!
// @ts-check
export default /** @type {import('astro').AstroUserConfig} */ ({
  renderers: ['@astrojs/renderer-vue'],
  buildOptions: {
    site: 'https://me.github.io',
    sitemap: true,
  },
});

I was going to open a bug, when I decided to make a clean project and copy&paste the examples in the documentation which (with the exception of an extra ../ in the layout) work as expected.

Any idea where should I even start looking for the issue?

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