From 993aa1af96dc9ed5f08af3d513f55c4d089dfabd Mon Sep 17 00:00:00 2001 From: Prabhat Jain Date: Sat, 10 Jan 2026 13:40:58 -0500 Subject: [PATCH] Fix: Added react/jsv-dev-runtime to fakeRequire in compileMDX. Before the compileMDX function was only handing 'react/jsx-runtime' imports but in dev mode Next.js use 'react/jsx-dev-runtime' which exports jsxDEV. This was causing a 'jsxDEV is not a function' error when running yarn dev. This fix adds handling for 'react/jsx-dev-runtime' to the fakeRequire function, resolving the development mode compilation error. --- src/utils/compileMDX.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/compileMDX.ts b/src/utils/compileMDX.ts index c312f03fe96..67946c5c9ae 100644 --- a/src/utils/compileMDX.ts +++ b/src/utils/compileMDX.ts @@ -106,6 +106,8 @@ export default async function compileMDX( const fakeRequire = (name: string) => { if (name === 'react/jsx-runtime') { return require('react/jsx-runtime'); + } else if (name === 'react/jsx-dev-runtime') { + return require('react/jsx-dev-runtime'); } else { // For each fake MDX import, give back the string component name. // It will get serialized later.