Remark and rehype plugins not working to render markdown links
See original GitHub issueVersion
@nuxt/content: 1.15.1 nuxt: 2.15.7
Reproduction Link
https://github.com/hiurequeiroz/my-page
Steps to reproduce
I add the rehype plugin (I try with remark plugin too)
yarn add rehype-external-links
Put the conf in nuxt.config.js:
content: {
markdown: {
rehypePlugins: () => [
'rehype-external-links'
]
}
},
And in my markdown files i put some links
[instituto pandavas](http://institutopandavas.org.br)
What is Expected?
I expected nuxt render the markdown links
What is actually happening?
The final page dont render the links
I get this error:
ERROR Error [ERR_REQUIRE_ESM]: require() of ES Module /mnt/Arquivos/gits/pagina-hiure/node_modules/rehype-external-links/index.js from /mnt/Arquivos/gits/pagina-hiure/node_modules/@nuxt/content/lib/utils.js not supported.
Instead change the require of index.js in /mnt/Arquivos/gits/pagina-hiure/node_modules/@nuxt/content/lib/utils.js to a dynamic import() which is available in all CommonJS modules.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Transforming Markdown with Remark & Rehype - ryanfiller.com
Writing custom plugins to give extra powers to Markdown syntax using the Unified ecosystem.
Read more >Using Remark and Rehype plugins with MDX in Next.js (with ...
I tried running this, using the yarn dev and everything works, except that none of the markdown plugins are functioning at all. (The...
Read more >Next.js with MDX tips: Provide shortcuts to article headings
This tutorial will teach you how to automatically add links to heading tags in your mdx posts on your Next.js site with a...
Read more >react-markdown | Yarn - Package Manager
react-markdown ... React component to render markdown. ... (migrate by renaming it to remarkPlugins ); 36e4916 Update remark-rehype , add support for ...
Read more >remark - Keywords - unified
remark plugin that turns markdown into HTML to support rehype ... configure remark-lint with rules that prevent mistakes or stuff that fails across...
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 FreeTop 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
Top GitHub Comments
I have the same problem.
“@nuxt/content”: “^1.15.1” “nuxt”: “^2.15.8”
I’m trying to use: “remark-emoji”: “^3.0.2”
Apparently, it’s related to; “Note that this package is ESM only from v3.0.0 since remark packages migrated to ESM.”. https://github.com/rhysd/remark-emoji#usage
Edit: I solved it using the version of the package that uses
require()
instead ofimport
Hey!
As we are using latest versions of Remark & Rehype and Nuxt 3 gives support for ESM modules, all of this should be fine using @nuxt/content v2.
I am so closing this issue, but feel free to re-open if you still have the problem!.