3

I am using MDX in my NEXT.JS project with the react-math and rehype-katex plugins. When I render the MDX files it gives me errors:

"LaTeX-incompatible input and strict mode is set to 'warn': In LaTeX, \ or \newline does nothing in display mode [newLineInDisplayMode]"

Flowing are my next.config.mjs file.

import nextMDX from '@next/mdx';
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';

const nextConfig = {
  reactStrictMode: true,
};

const withMDX = nextMDX({
  extension: /\.mdx?$/,
  options: {
    remarkPlugins: [remarkMath],
    rehypePlugins: [rehypeKatex],
    // If you use `MDXProvider`, uncomment the following line.
    providerImportSource: '@mdx-js/react',
  },
});

export default withMDX({
  // Append the default value with md extensions
  nextConfig,
  pageExtensions: ['js', 'jsx', 'md', 'mdx'],
});

Any one knows how can I fix this or turn off the strict mode warnings? Thanks !

juliomalves
  • 42,130
  • 20
  • 150
  • 146
JL L
  • 31
  • 1

0 Answers0