Error when including rehype plugins
See original GitHub issue🐛 Bug Report
Unable to add rehypePlugins in docusaurus.config.js. Results in following error during docuasaurus start
and docusaurus build
.
ValidationError: "rehypePlugins[0]" must be a string
Have you read the Contributing Guidelines on issues?
Yes.
To Reproduce
(Write your steps here:)
npx @docusaurus/init@next init docusaurus classic
npm i --save remark-math rehype-katex
- In docusaurus.config.js import the two packages and add to docs:
const katex = require("rehype-katex");
const math = require("remark-math");
module.exports = {
// ...
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
// It is recommended to set document id as docs home page (`docs/` path).
homePageId: "doc1",
sidebarPath: require.resolve("./sidebars.js"),
remarkPlugins: [math],
rehypePlugins: [katex],
// Please change this to your repo.
editUrl:
"https://github.com/facebook/docusaurus/edit/master/website/",
},
// ...
},
],
],
};
docusaurus start
Expected behavior
Expect to be able to serve website.
Actual Behavior
docusaurus start
Starting the development server...
ValidationError: "rehypePlugins[0]" must be a string
(Write what happened. Add screenshots, if applicable.)
Your Environment
- Docusaurus version used: 2.0.0-alpha.59
- Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Node 14.5.0
- Operating system and version (desktop or mobile): Windows 10
Reproducible Demo
https://github.com/mattcorner/docusaurus-equations-error/blob/master/docusaurus.config.js
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
rehype-katex - unified
rehype plugin to transform inline and block math with KaTeX. ... Throw if a KaTeX parse error occurs ( boolean , default: false...
Read more >gatsby-plugin-mdx with rehype-autolink-headers only working ...
I have tried using the rehype and remark plugins for this, but I can only get the Rehype plugin to work and only...
Read more >rehype-format - npm
rehype plugin to format HTML. Latest version: 4.0.1, last published: a year ago. Start using rehype-format in your project by running `npm i ......
Read more >plugin-content-docs | Docusaurus
rehypePlugins, any[], [], Rehype plugins passed to MDX. ... Will error if includeCurrentVersion: false and disableVersioning: true .
Read more >Transforming Markdown with Remark & Rehype - ryanfiller.com
A nice thing about rehype plugins is that if they return an error, they do not transform the node and move on. If,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@teikjun can you take a look please?
This still seems to be an issue, following the docs at https://v2.docusaurus.io/docs/markdown-features#configuring-plugins I get an error in validation when using this config which is straight out of the docs