Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when running MDEditor in NextJS #465

Open
ZacMelendez opened this issue Dec 21, 2022 · 1 comment
Open

TypeError when running MDEditor in NextJS #465

ZacMelendez opened this issue Dec 21, 2022 · 1 comment

Comments

@ZacMelendez
Copy link

I am running v3.20.1 of react-md-editor, in NextJS v13.0.7, trying to use the MDEditor with react-hook-forms under a controlled input. It works well, except for the fact that every other page load or so, I get this error:

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'source')

Call Stack
source
node_modules/rehype-prism-plus/node_modules/refractor/lang/js-templates.js (12:56)
Prism
node_modules/rehype-prism-plus/node_modules/refractor/lang/js-templates.js (375:5)
syntax
node_modules/rehype-prism-plus/node_modules/refractor/lib/core.js (125:4)
refractor
node_modules/rehype-prism-plus/node_modules/refractor/lib/all.js (454:0)
./node_modules/rehype-prism-plus/node_modules/refractor/lib/all.js
file:///Users/zachm/Desktop/dev/zachoverflow/.next/static/chunks/node_modules_uiw_react-md-editor_esm_index_js.js (5338:1)
options.factory
/_next/static/chunks/webpack.js (713:31)
__webpack_require__
file:///Users/zachm/Desktop/dev/zachoverflow/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (368:21)
eval
webpack-internal:///./node_modules/rehype-prism-plus/dist/rehype-prism-plus.es.js (12:78)
./node_modules/rehype-prism-plus/dist/rehype-prism-plus.es.js
file:///Users/zachm/Desktop/dev/zachoverflow/.next/static/chunks/node_modules_uiw_react-md-editor_esm_index_js.js (1978:1)
options.factory
/_next/static/chunks/webpack.js (713:31)
__webpack_require__
file:///Users/zachm/Desktop/dev/zachoverflow/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (368:21)
eval
webpack-internal:///./node_modules/@uiw/react-markdown-preview/esm/index.js (13:75)
./node_modules/@uiw/react-markdown-preview/esm/index.js
file:///Users/zachm/Desktop/dev/zachoverflow/.next/static/chunks/node_modules_uiw_react-md-editor_esm_index_js.js (28:1)
options.factory
/_next/static/chunks/webpack.js (713:31)
__webpack_require__
file:///Users/zachm/Desktop/dev/zachoverflow/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (368:21)
eval
webpack-internal:///./node_modules/@uiw/react-md-editor/esm/Editor.js (6:85)
./node_modules/@uiw/react-md-editor/esm/Editor.js
file:///Users/zachm/Desktop/dev/zachoverflow/.next/static/chunks/node_modules_uiw_react-md-editor_esm_index_js.js (94:1)
options.factory
/_next/static/chunks/webpack.js (713:31)
__webpack_require__
file:///Users/zachm/Desktop/dev/zachoverflow/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (368:21)
eval
webpack-internal:///./node_modules/@uiw/react-md-editor/esm/index.js (6:65)
./node_modules/@uiw/react-md-editor/esm/index.js
file:///Users/zachm/Desktop/dev/zachoverflow/.next/static/chunks/node_modules_uiw_react-md-editor_esm_index_js.js (435:1)
options.factory
/_next/static/chunks/webpack.js (713:31)
__webpack_require__
file:///Users/zachm/Desktop/dev/zachoverflow/.next/static/chunks/webpack.js (37:33)
Function.fn
/_next/static/chunks/webpack.js (368:21)

I am fine with ignoring it, as it is not every single time, but I am not sure why the error is happening. Can anyone assist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants