docusaurus plugin-content-docs "Error: plugin not found" build failed
Fixes Docusaurus 'plugin not found' failure for plugin-content-docs. Use when the build fails because the docs plugin cannot be resolved. Key trigger: the plugin not found error naming @docusaurus/plugin-content-docs. Usually a missing install or a manual plugins entry that preset-classic already provides.
Fix Docusaurus plugin-content-docs "plugin not found" failures
TL;DR
The site config references the docs plugin but Node cannot resolve it: either the package was never installed, or it is listed manually in plugins while preset-classic already bundles it. Install the package (or remove the redundant manual entry), then rebuild. The build passes because the plugin name now resolves to real code.
The error
Error: plugin not found: @docusaurus/plugin-content-docs
at loadPlugin (node_modules/@docusaurus/core/lib/server/plugins/index.js)Steps
- Check whether it is installed:
npm ls @docusaurus/plugin-content-docs.
Expected: either a version tree or an '(empty)' / not-found note.
- If it is missing, install it:
npm install @docusaurus/plugin-content-docs.
Expected: the package appears in package.json dependencies and node_modules.
- If the site uses @docusaurus/preset-classic, do NOT also list the plugin in the
pluginsarray of docusaurus.config.js - the preset already includes it. Remove the manual entry instead of installing.
Expected: the plugin is provided exactly once: by the preset or by the manual entry, not both.
- Check the plugins array for typos in the package name.
Expected: the name matches the installed package exactly.
- Rebuild:
npm run build.
Expected: the plugin loads and the docs routes build with no plugin error.
Use this when
- the build fails naming @docusaurus/plugin-content-docs as not found
- a Docusaurus site scaffolded by hand rather than the CLI template
- the plugin was removed from package.json during a dependency cleanup
Not for this skill when
- 'broken markdown link' (content problem, the plugin loaded fine)
- 'MDX compilation failed' (a page does not parse)
- a plugin that loads but misbehaves (wrong options, not a resolution failure)
Variant phrasings
- docusaurus plugin-content-docs not found
- docusaurus Error plugin not found build
- docusaurus preset-classic plugin-content-docs duplicate
- @docusaurus/plugin-content-docs missing
Why it happens
Docusaurus resolves each entry in the config's plugins array as a Node module at startup. The docs plugin ships inside @docusaurus/preset-classic, which most templates use, so hand-edited configs often add a second manual entry or reference the plugin in a project that never installed it. Either way the resolver fails before any page builds, which is why the error names the plugin rather than a file.
Edge cases
- After changing plugins, delete the .docusaurus cache directory; stale plugin state there can survive a config fix.
- Version skew between the plugin and @docusaurus/core produces cryptic errors later in the build - keep all @docusaurus/* packages on the same version.
- The same 'plugin not found' shape applies to any community plugin; the diagnosis (npm ls, then install or de-duplicate) is identical.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_dP8eudKJtuQbI9UzUKfHWg