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

children.match is not a function when using HTML entity numbers inside <code> inside markdown table #15359

Closed
netcoding87 opened this issue Jun 25, 2021 · 4 comments

Comments

@netcoding87
Copy link

netcoding87 commented Jun 25, 2021

Describe the bug
When using an HTML entity number inside a <code> element inside a markdown table the storybook crashes with Uncaught TypeError: children.match is not a function at Code

To Reproduce
GitHub Repo: https://github.com/netcoding87/storybook-html-entity

  • Start storybook
  • Open Story 1 => code is shown
  • Open Story 2 => Exception occurs

System

  • System:
    • OS: Windows 10 10.0.19042
    • CPU: (8) x64 Intel(R) Core(TM) i5-10400H CPU @ 2.60GHz
  • Binaries:
    • Node: 14.16.0 - C:\Program Files\nodejs\node.EXE
    • Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    • npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
  • Browsers:
    • Edge: Spartan (44.19041.964.0), Chromium (91.0.864.54)

Additional context
This problem arose with updating from 6.2.9 to 6.3.0

@codylindley
Copy link

codylindley commented Jun 29, 2021

I'm seeing this as well when I moved from 6.2.9 to 6.3.1. Basically, everything works fine until an MDX docs page is visited then storybook breaks with the reported error.

Screen Shot 2021-06-29 at 9 09 32 AM

@literalpie
Copy link
Contributor

I'm seeing this, but I'm not sure the exact pattern of what causes it. We don't have any HTML entity numbers, but we are seeing it when using a code block in the description of an angular directive (which gets displayed outside any tables). However, we are not seeing the issue when there is code within the comment of an input on a component (which gets displayed inside a table).

Hopefully that helps narrow down the issue somehow :-)

@literalpie
Copy link
Contributor

I don't have time to test it, but I think making children optional here might fix the issue

westwood846 pushed a commit to glints-dev/glints-aries that referenced this issue Sep 9, 2021
For some reason these <code> elements cause an error 'children.match is not
a function' and prevent the page from rendering. Might be related to
storybookjs/storybook#15359. I don't have time to
find a fix for this, so I'm just switching to <span>s for now.
westwood846 pushed a commit to glints-dev/glints-aries that referenced this issue Sep 9, 2021
For some reason these <code> elements cause an error 'children.match is not
a function' and prevent the page from rendering. Might be related to
storybookjs/storybook#15359. I don't have time to
find a fix for this, so I'm just switching to <span>s for now.
@shilman
Copy link
Member

shilman commented Oct 4, 2021

Egads!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-beta.4 containing PR #15492 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants