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

Crash with Uncaught Error: TextRenderer(...): Nothing was returned from render. #494

Closed
christianwiese opened this issue Oct 21, 2020 · 2 comments
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem

Comments

@christianwiese
Copy link

christianwiese commented Oct 21, 2020

Hello everyone,
we are using the latest version of react-markdown in combination with the remark-gfm plugin and are experiencing crashes when trying to display a bold list item with a checkbox. It actually happens with any formatted text after the checkbox.
Let me know if this is the right place to raise this issue or if this is rather remark-gfm related.

Your environment

  • React@16.14.0
  • react-markdown@5.0.0
  • remark-gfm@1.0.0

Steps to reproduce

Use the following string in a markdown component.

- [ ] **important task**

Expected behavior

A bold list item with a checkbox is rendered.

Actual behavior

Uncaught Error: TextRenderer(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.
The above error occurred in the <TextRenderer> component:
    in TextRenderer (created by ReactMarkdown)
    in li (created by ListItem)
    in ListItem (created by ReactMarkdown)
    in ul (created by List)
    in List (created by ReactMarkdown)
    in Root (created by ReactMarkdown)
    in ReactMarkdown (at markdown.tsx:13)
@christianwiese christianwiese added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Oct 21, 2020
@ChristianMurphy
Copy link
Member

I'm able to reproduce the issue in a codesandbox https://codesandbox.io/s/angry-cache-9ep18

@ChristianMurphy ChristianMurphy added 🐛 type/bug This is a problem 🙆 yes/confirmed This is confirmed and ready to be worked on and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Oct 21, 2020
@wooorm wooorm closed this as completed in c3dc5ee Oct 21, 2020
wooorm added a commit to syntax-tree/mdast-util-gfm-task-list-item that referenced this issue Oct 21, 2020
@wooorm
Copy link
Member

wooorm commented Oct 21, 2020

Found it, fixed in the source project that made an empty text node, which doesn’t make sense; but also here, to handle empty text nodes if they for some reason exist

@wooorm wooorm added ⛵️ status/released 👶 semver/patch This is a backwards-compatible fix 🗄 area/interface This affects the public interface and removed 🙆 yes/confirmed This is confirmed and ready to be worked on labels Oct 21, 2020
@wooorm wooorm added the 💪 phase/solved Post is done label Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem
Development

No branches or pull requests

3 participants