Appendix C: Troubleshooting and Glossary

By Syncfusion®, Inc. · Last updated

Common Astro errors and problems with their causes and fixes, plus a one-line glossary of every term used in the course.

Appendix C: Troubleshooting and Glossary

  • Part 1 lists common problems: what you see, why it happens, and how to fix it.
  • Part 2 explains the words used in the course, in one line each.

Part 1: Troubleshooting

Build and Compile Errors

You seeWhyFix
Unable to render X. No valid renderer was foundA .tsx/.jsx component without its frameworknpx astro add preact (or react, vue...)
<p> on line 4 is never closedAstro 7 needs every tag closedAdd </p>, </div>...
getStaticPaths() function is requiredA [param] page that is staticExport getStaticPaths(), or make the page on demand
No adapter installed / "needs an adapter"On-demand page, session, action or server islandnpx astro add node (or your host)
Cannot find module '../components/Card.astro'Wrong path or file name caseCheck the folder and the exact spelling
X data does not match the collection schemaA post's frontmatter breaks the Zod schemaRead the field name in the message and fix the post
Missing environment variableastro:env required a variable that is not setAdd it to .env locally, and to the host dashboard

Things That Do Not Work

ProblemLikely causeFix
A framework button ignores clicksNo client:* directiveAdd client:load or client:visible
window is not definedBrowser code ran on the serverMove it to a <script>, useEffect, or use client:only
A button works only on the first page<ClientRouter /> runs scripts onceSet up in document.addEventListener("astro:page-load", ...)
Styles do not reach a child componentStyles are scopedUse :global() or pass a class prop
My console.log shows nothingLooking in the wrong consoleFrontmatter → terminal, <script> → browser DevTools
Astro.session is undefinedThe page is staticMake the page on demand
A new post does not show on the live siteStatic pages are built onceRebuild, or use on-demand or live data
Links 404 on GitHub Pagesbase is missing from linksBuild links from import.meta.env.BASE_URL
An image is not foundWrong relative pathImports are relative to the file; public/ paths start with /

Stuck? Make the smallest page that still shows the problem. Half the time you find the cause while making it. The other half, it is the perfect example to share on the Astro Discord.

After changing astro.config.mjs, content.config.ts or .env, restart npm run dev. Some changes are only read at start-up.

Part 2: Glossary

WordMeaning
AdapterA plugin that lets on-demand pages run on a host (Node, Netlify, Vercel, Cloudflare)
BuildTurning src/ into the finished site in dist/
CacheA saved copy of a response, reused to answer faster
CDNServers around the world that hold copies of your site near visitors
Client directiveA client:* attribute that hydrates an island
CollectionA group of content (posts, authors) with a schema
ComponentA reusable piece of UI in its own file
Container APIRenders an Astro component to HTML outside a site, for tests
CookieA small piece of text the browser stores and sends with requests
EndpointA route file that returns data (JSON, XML) instead of a page
FrontmatterThe code between the --- lines of an .astro file, or the data at the top of a Markdown file
HydrationAttaching JavaScript to server HTML so it becomes interactive
i18nInternationalization: a site in more than one language
IntegrationA plugin that adds features to Astro (preact, sitemap, mdx)
IslandOne interactive component on a mostly static page
LayoutA component that wraps pages with shared HTML
Live collectionContent loaded on every request instead of at build time
MiddlewareCode that runs before every on-demand request
On-demand renderingBuilding a page on the server for each request (SSR)
PrefetchLoading a page in the background before the click
PrerenderBuilding a page ahead of time, at build time (SSG)
PropsValues passed into a component
RouteA URL and the file that answers it
SchemaRules for the shape of data, written with Zod
Server islandA component rendered on the server after the page, with server:defer
SessionPer-visitor data kept on the server, linked by a cookie
SlotA placeholder where a component shows the content passed into it
SSG / SSR / CSRStatic site generation / server-side rendering / client-side rendering
View transitionAn animation between two pages
ZodThe library Astro uses to describe and check data

Forgot a word? Search this page with Ctrl+F (Cmd+F on a Mac).