question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing error when a component is used within a markdown list

See original GitHub issue

Subject of the issue

The following code:

- <LinkTo kind="docs-packages-vuetify-preset" story="page">
    Vuetify preset
  </LinkTo>
  : some extra text describing the preset

Trigger an error on line 3:

  </LinkTo>
    ^^^^^^
    Parsing error: '>' expected.

Adding an empty line between the last two lines fixes the issue, but the rendered output is not the same. Also putting it all in a single line works, but it’s not “Prettier compliant” and gets reformatted on multiple lines. If the same code is placed at the root (not within a markdown list), it works as well.

It does pretty much the same with a regular element instead of a component, but the error is different:

Parsing error: Identifier expected

Note that the code compiles properly, the problem is only at EsLint level.

Your environment

  • OS: macOS 10.15.7
  • Packages: eslint-plugin-mdx 1.9.0
  • Env: Node 14.16.0, npm 6.14.11

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
JounQincommented, Mar 5, 2021

@LeBenLeBen Temporary workaround:

<!-- prettier-ignore -->
- <div kind="docs-packages-vuetify-preset" story="page">
    Vuetify preset
</div>
  : some extra text describing the preset

Sorry, I can’t fix it easily due to remark-mdx itself. Let’s wait for @wooorm’s response.

0reactions
LeBenLeBencommented, Mar 11, 2021

Perfect, it works now. Thank you for looking into this so quickly 💯

Read more comments on GitHub >

github_iconTop Results From Across the Web

Markdown list error: </li> attempted to close an element that ...
I'm trying to use some markdown inside Svelte components, and it mostly works fine, e.g.:
Read more >
Code blocks in mdx throw errors due to code parsing
This happens on a post where I am writing about classes and functional react components and in one of my examples I have...
Read more >
6 Deciphering Common R Errors | Getting Used to R, RStudio ...
This error usually occurs when your R Markdown document refers to an object that has not been defined in an R chunk at...
Read more >
How to safely render Markdown using react-markdown
Learn how to safely render Markdown syntax to the appropriate HTML with this short react-markdown tutorial.
Read more >
Troubleshooting MDX
Could not parse import/exports with acorn: $error ... The reason for this error is that the parser is expecting a JavaScript import or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found