Remark-mermaid with Next.js #1141
Answered
by
remcohaszing
celinehaddad
asked this question in
Q&A
-
Hey all, I installed the remark-mermaid plugin to my Next app, but I am hitting this error:
This is what I have set up for the remark-mermaid options: <ReactMarkdown
remarkPlugins={[
remarkTab,
[remarkChangeImagePath, props.imageBasePath, props.pageUrl],
remarkCleanLinkUrl,
remarkGfm,
remarkBreaks,
remarkDirective,
remarkNote,
remarkCollapsed,
[
remarkMermaid,
{
launchOptions: {
executablePath: "path/to/chrome/executable",
},
errorFallback: "file",
},
],
]}
rehypePlugins={[rehypeSlug, anchorHeading, rehypeRaw]}
remarkRehypeOptions={{
handlers: {
tablist: (h, node) => h(node, "tablist", node, all(h, node)),
tab: (h, node) => h(node, "tab", node, all(h, node)),
},
}}
components={components}
>
{props.markdown}
</ReactMarkdown> I have gathered that fs is a core Node module & provides access to the file system, so it can't be used in a browser environment. Any ideas for alternative approaches that can be used in a browser environment? |
Beta Was this translation helpful? Give feedback.
Answered by
remcohaszing
Mar 29, 2023
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ChristianMurphy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
remark-mermaid
is no longer maintained. I recommend tryingremark-mermaidjs
instead.