flowershow icon indicating copy to clipboard operation
flowershow copied to clipboard

`next-mdx-remote` related errors when project is built with SSR

Open olayway opened this issue 2 years ago • 3 comments

After switching to SSR on this branch, when the project is built with next build and then started with next start the following error shows up in the console:

main-1ad9ee0332d81828.js:1 TypeError: _jsxDEV is not a function
    at _createMdxContent (eval at <anonymous> ([[...slug]]-905ad805df086d93.js:1:1286), <anonymous>:12:16)
    at MDXContent (eval at <anonymous> ([[...slug]]-905ad805df086d93.js:1:1286), <anonymous>:38:14)
    at ab (framework-73b8966a3c579ab0.js:9:60917)
    at i (framework-73b8966a3c579ab0.js:9:119475)
    at oO (framework-73b8966a3c579ab0.js:9:99114)
    at framework-73b8966a3c579ab0.js:9:98981
    at oF (framework-73b8966a3c579ab0.js:9:98988)
    at ox (framework-73b8966a3c579ab0.js:9:95740)
    at oS (framework-73b8966a3c579ab0.js:9:94295)
    at x (framework-73b8966a3c579ab0.js:33:1373)

This doesn't happen when starting the project with next dev though.

Related open discussion on next-mdx-remote repository: https://github.com/hashicorp/next-mdx-remote/issues/350

olayway avatar Jun 30 '23 12:06 olayway

Found a workaround:

  1. Setting development: process.env.NODE_ENV === 'development' in the mdxOptions
  2. Downgrading next-mdx-remote to 4.2.0.

Full info here: https://github.com/hashicorp/next-mdx-remote/issues/350#issuecomment-1614603635

olayway avatar Jun 30 '23 12:06 olayway

It doesn't work again. @rufuspollock this is a main blocker atm for me to develop the cloud version of the template. I don't understand what's causing the error...

olayway avatar Jul 04 '23 10:07 olayway

@olayway i assume this is no longer issue as we have a cloud version of the template working - can you confirm and we can close as FIXED or WONTFIX or whatever.

rufuspollock avatar Jan 01 '24 23:01 rufuspollock