How to Fix the Most Common Astro Errors
The errors beginners hit most often in Astro, what they actually mean, and how to fix each one.
Tested on Astro 7.4

In this guide
Errors look scary, but Astro’s are usually specific. Read them for the file name and line number first. We triggered each of these on Astro 7.4 so that you can see exactly what they say.
astro: command not found
sh: astro: command not found
What it means: your project’s tools aren’t installed.
How to fix it: run npm install inside your project folder. If it still fails, check you’re in the right folder. Your terminal should be in the one containing package.json.
Expected corresponding JSX closing tag
[CompilerError] Expected corresponding JSX closing tag for 'div'.
What it means: you opened a tag and never closed it. Older versions of Astro let this go, but Astro 7 doesn’t.
How to fix it: the error gives you the file and line. Look for a <div>, <p> or similar with no closing tag. Tags like <br> and <img> don’t need closing.
Could not resolve
Could not resolve '../layout/Layout.astro' in src/pages/about.astro
What it means: an import points at a file that isn’t there.
How to fix it: check the spelling and the path. In this example, the folder is layouts, not layout. Remember that ../ means “go up one folder”.
Missing data in a blog post
title: Required
What it means: a Markdown post is missing something your schema requires.
How to fix it: the error names the file. Add the missing field to the section at the top of that post.
My new collection or page isn’t showing up
What it means: the dev server may not have noticed a new config file.
How to fix it: stop the server with Ctrl and C, then run npm run dev again.
My words have run together
What it means: since Astro 7, spaces between inline elements are removed. So <b>Hello</b> <i>world</i> on separate lines can display as “Helloworld”.
How to fix it: add an explicit space with {" "} between the two elements.
None of these match
Copy the first line of your error into a search engine with the word “Astro”, or ask in the Astro Discord. Say which version you’re on, which you can find by running npx astro --version.
Stuck on a step?
Check the common errors guide, look up a word in the glossary, or ask in the official Astro Discord, where the support channels are friendly to beginners.