Compile error when using plugin rehype-raw
See original GitHub issueSubject of the issue
Compile error occurs when react-markdown is used with plugin rehype-raw.
Your environment
- OS: Ubuntu 20.04.2 LTS
- Packages: See the package.json file in the Github repo provided below
- Env: *node: v15.14.0 *npm: v7.7.6 *Firefox: v88.0
Steps to reproduce
I created a MWE in this Github repo with which the error can be reproduced. Simply run npm install
and npm start
.
Expected behavior
No errors, code compiling and app starting normally.
Actual behavior
I get this error:
Additional note
Removing the rehype plugin, makes the code compile and run normally.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
ReactMarkdown fails when using in combination with rehype ...
I've been trying to make markdown render MDX html and jsx tags using rehype-raw and i get the following error: Cannot compile 'html'...
Read more >Use rehype-raw in react-markdown to parse HTML element ...
I'm using typescript in my react project, however when I use this code snippet I get an error <ReactMarkdown rehypePlugins={[rehypeRaw]}> ...
Read more >E Compile Error caused by line 39 - WordPress.org
An error of type E_COMPILE_ERROR was caused in line 39 of the file /var/www/wp-content/plugins/woocommerce/vendor/jetpack-autoloader/autoload_functions.php.
Read more >react-markdown - npm
Start using react-markdown in your project by running `npm i ... You can pass plugins to change how markdown is transformed to React ......
Read more >Compile Error when adding C++ class to Plugin
Hi, I am trying to get a bit into plugin development, but i am running into a problem right at the start. When...
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
Here’s a little playground you can use: https://codesandbox.io/s/react-markdown-debug-9n4eg. It might be that the
react-markdown
you have is out of date?I erroneously put
rehype-raw
in theremarkPlugin
parameter. The fix was to simply put it in therehypePlugins
parameter instead. Hope that helps. As for your issue, I’m not sure what the problem is. @ChristianMurphy?