My Next.js app is using MDX to display content. When I run the app in development mode, it works fine. However, when I deploy the app on github pages, I get the error: "TypeError: error must be an instance of Error" inside my next.config.mjs file when the website is building.
My next.config.mjs file looks like this:
"""
import createMDX from '@next/mdx'
/** @type {import('next').NextConfig} */
const nextConfig = {
// Configure `pageExtensions`` to include MDX files
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
// Optionally, add any other Next.js config below
}
const withMDX = createMDX({
// Add markdown plugins here, as desired
})
// Wrap MDX and Next.js config with each other
export default withMDX(nextConfig)
"""
Do you have any idea what the problem could be?