Установите MDX для NextJS
npm install --save @next/mdx @mdx-js/loader
Old-fashioned Ostrich
npm install --save @next/mdx @mdx-js/loader