uiwjs / uiwjs/react-md-editor

Multiline code block crashing page

Open
#559 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.9k
Forks
201
Avg merge
12m
Merged PRs (30d)
1

Description

When using the ``` code block, the whole page crashes with multiple errors in the console:

react-dom.development.js:18687 The above error occurred in the <ReactMarkdown> component:

    at ReactMarkdown (https://website/static/js/bundle.js:233154:42)
    at div
    at https://website/static/js/bundle.js:38066:32
    at div
    at div
    at div
    at https://website/static/js/bundle.js:38452:70
    at div
    at AjaxElementLoader (https://website/static/js/bundle.js:933:143)
    at AjaxWidgetLoader (https://website/static/js/bundle.js:1041:143)
    at Note (https://website/static/js/bundle.js:14205:143)
    at ConnectFunction (https://website/static/js/bundle.js:159021:68)
    at div
    at div
    at Widget (https://website/static/js/bundle.js:9445:143)
    at div
    at Resizable (https://website/static/js/bundle.js:161498:35)
    at DraggableCore (https://website/static/js/bundle.js:150793:5)
    at GridItem (https://website/static/js/bundle.js:152323:5)
    at div
    at ReactGridLayout (https://website/static/js/bundle.js:153240:5)
    at ResponsiveReactGridLayout (https://website/static/js/bundle.js:154546:5)
    at WidthProvider (https://website/static/js/bundle.js:155303:7)
    at DashboardGrid (https://website/static/js/bundle.js:2490:143)
    at ConnectFunction (https://website/static/js/bundle.js:159021:68)
    at section
    at App (https://website/static/js/bundle.js:1317:143)
    at ConnectFunction (https://website/static/js/bundle.js:159021:68)
    at CatchError (https://website/static/js/bundle.js:2074:143)
    at Provider (https://website/static/js/bundle.js:158723:20)

React will try to recreate this component tree from scratch using the error boundary you provided, CatchError.

TypeError: N.entries is not a function
    at l (generator.js:304:1)
    at overload (index.js:173:1)
    at node (element<code>) (index.js:189:1)
    at node (element<pre>) (index.js:206:1)
    at node (root) (index.js:206:1)
    at visitParents (index.js:148:1)
    at visit (index.js:165:1)
    at generator.js:177:1
    at wrapped (index.js:115:1)
    at next (index.js:65:1) 

I am using the latest version with react 18.2.0, and have tried copying directly from the README and the error still occurs

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the crash with a multiline ``` code block and inspect the ReactMarkdown component and the generator.js/index.js stack entries reported in the issue. Trace why rendering code/pre nodes reaches the N.entries error, then verify that the page remains usable and the code block renders without console errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.