Next.js Discord

Discord Forum

remarkSVGBob with nextMDX

Unanswered
English Spot posted this in #help-forum
Open in Discord
English SpotOP
Hi guys

How do I configure nextMDX to use remarkSVGBob for processing svgbob content into SVG?

1 Reply

English SpotOP
I have been digging into this a bit more. I have remark-svgbob configured like this
import remarkSVGBob from "remark-svgbob";
const withMDX = nextMDX({
  extension: /\.mdx?$/,
  options: {
    remarkPlugins: [remarkSVGBob],
    rehypePlugins: [],
  },
});


I can see that the svgbob code blocks are being processed by the remark-svgbob plugin, and I can print the generated SVG to the console fine.

The problem I am having is that the page compilation fails with the error:
 ⨯ ./src/app/page.mdx
Error: page.mdx:Error: Cannot handle unknown node `raw`
Import trace for requested module:
./src/app/page.mdx


Can anybody here help me please?