Skip to content

Solution for [ERROR] [NoMatchingRenderer] Unable to render in Astro

I encountered the following error message in Astro:

I solved it, so here’s a note for future reference.

Cause of the error

This error indicates that no appropriate renderer was found for the specified component.

In my case, I was using Astro’s Starlight theme and encountered this error when trying to load the Button component from shadcn/ui.

The shadcn/ui is a React component, and Astro’s Starlight wasn’t using React, which caused this error. (I completely misunderstood that it was fully included…)

While this was my specific case, it’s highly likely that you’re missing some renderer necessary to display a particular component.

Solution

Once I realized that the cause was a missing React component renderer, I resolved it with the following steps:

Terminal window
pnpm astro add react

This allowed me to use React components in Astro, resolving the error.

For cases other than React, you might be missing libraries needed for rendering. Try adding the missing library by referring to the error message.