question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compile error when using plugin rehype-raw

See original GitHub issue

Subject 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:

image

Additional note

Removing the rehype plugin, makes the code compile and run normally.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wooormcommented, Apr 30, 2021

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?

1reaction
Ethunxxxcommented, Apr 30, 2021

I erroneously put rehype-raw in the remarkPlugin parameter. The fix was to simply put it in the rehypePlugins parameter instead. Hope that helps. As for your issue, I’m not sure what the problem is. @ChristianMurphy?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found