uiwjs / react-md-editor

A simple markdown editor with preview, implemented with React.js and TypeScript.
https://uiwjs.github.io/react-md-editor
MIT License
2.15k stars 155 forks source link

NextJS 13 - "Module not found" #561

Closed ezeamin closed 1 year ago

ezeamin commented 1 year ago

When I try to run the editor, without any other extra config, I get this error:

- error ./node_modules/@uiw/react-markdown-preview/lib/index.js:20:0
Module not found: Package path . is not exported from package /workspace/node_modules/rehype-prism-plus (see exports field in /workspace/node_modules/rehype-prism-plus/package.json)

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/@uiw/react-md-editor/lib/Editor.js
./node_modules/@uiw/react-md-editor/lib/index.js
./components/Editor.tsx

Link to the codesandbox

jaywcjlove commented 1 year ago

@ezeamin Remove the node_modules and package-lock.json directories and reinstall dependencies.

$ rm -rf node_modules package-lock.json
$ npm install

Locked the version of the problematic package rehype-prism-plus

jaywcjlove commented 1 year ago

@ezeamin Bugs have been fixed.