Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!