datopian / flowershow

💐 Publish your obsidian digital garden or any markdown site easily and elegantly.
https://flowershow.app/
MIT License
750 stars 92 forks source link

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

Open olayway opened 1 year ago

olayway commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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...

rufuspollock commented 6 months ago

@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.