1

My website works in localhost, but with netlify and vercel it doesn't work. I have managed to track down the error, and it seems to be with react markdown. If I remove the code, my website pushes successfully to netlify and vercel. Here is the code :

    <ReactMarkdown
        children={currentNote ? currentNote.description : ""}
        components={components}
      />

    
   const components: ReactMarkdownOptions["components"] = {
      code({ node, inline, className, children, ...props }) {
       const match = /language-(\w+)/.exec(className || "");

      return !inline && match ? (
      <SyntaxHighlighter
        style={a11yDark}
        language={match[1]}
        PreTag="div"
        showLineNumbers
        children={String(children).replace(/\n$/, "")}
        {...props}
      />
    ) : (
      <code className={className} {...props}>
        {children}
      </code>
    );
  },
};
Joe Roe
  • 626
  • 3
  • 12
ES Sinc
  • 61
  • 5

0 Answers0