In your Next.js config.
const nextConfig = {
turbopack: {
resolveAlias: {
"next-mdx-import-source-file": "./mdx-components.ts",
},
},
};
The issue is caused by Turbopack. You can either disable it in the dev
command or add this extra config.