sanity-io / sanity-plugin-markdown

Markdown support in the Sanity Studio
MIT License
51 stars 8 forks source link

Issue with nextjs + hosted studio #58

Open magicspon opened 1 year ago

magicspon commented 1 year ago

Heyo,

I'm getting an error when using with nextjs 13.

When I navigate to my desk, at /studio I'm seeing a big ole error:

Error: require() of ES Module /Users/magicspon/bla/node_modules/react-markdown/index.js from /Users/magicspon/bla/node_modules/@uiw/react-markdown-preview/lib/index.js not supported.
Instead change the require of /Users/magicspon/bla/node_modules/react-markdown/index.js in /Users/magicspon/bla/node_modules/@uiw/react-markdown-preview/lib/index.js to a dynamic import() which is available in all CommonJS modules.

Has anyone managed to use this on a hosted nextjs site? I suspect the issue is next expects import/export rather than common js.

cheers

Ali-TM-original commented 1 year ago

Does this issue still exists?