diff --git a/app/blog/layout.tsx b/app/blog/layout.tsx index 1e6ef4b..f099c83 100644 --- a/app/blog/layout.tsx +++ b/app/blog/layout.tsx @@ -1,7 +1,10 @@ -'use client'; - import React from 'react'; -import { MDXProvider } from '@mdx-js/react'; +import dynamic from 'next/dynamic'; + +const MDXProvider = dynamic( + () => import('@mdx-js/react').then(mod => mod.MDXProvider), + { ssr: true } +); const components = { h1: (props: any) => ( diff --git a/next.config.js b/next.config.js index 7f072c9..8cda954 100644 --- a/next.config.js +++ b/next.config.js @@ -1,17 +1,12 @@ -const withMDX = require('@next/mdx')({ - extension: /\.mdx?$/, - options: { - remarkPlugins: [], - rehypePlugins: [], - }, -}); - /** @type {import('next').NextConfig} */ -const nextConfig = withMDX({ +const nextConfig = { images: { unoptimized: true, }, pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], -}); + experimental: { + mdxRs: true, + }, +}; module.exports = nextConfig;