MDX parsing error for components that are not self-closing (fixed, but not yet released)
See original GitHub issuePrettier 1.19.1 Playground link
--parser mdx
Input:
---
title: Home
---
import { Link } from "gatsby"
# Page title
Some paragraph
<Link to="/somewhere-else/">Go somewhere else</Link>
Output:
SyntaxError: Void elements do not have end tags "Link" (1:46)
> 1 | ---
| ^
2 | title: Home
3 | ---
4 |
Expected behavior:
This should not throw an error as it is valid MDX.
The following does not throw an error (Playground link):
<Link to="/somewhere-else/" label="Go somewhere else" />
It seems that the error is coming from the component not being self-closing.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:17 (10 by maintainers)
Top Results From Across the Web
Troubleshooting MDX
This article goes through several common problems and errors that might occur when using MDX.
Read more >eslint-mdx: Versions | Openbase
Full version history for eslint-mdx including change logs. ... release-v1 ... 1ef8b2c fix: adjacent self-closing jsx nodes parsing error - close #138 ...
Read more >Gatsby Changelog | 5.3.0
In PR #36623 we fixed this behavior and any node changes (either by changing local files or through webhook updates) will be reflected...
Read more >Support MDX file format : WEB-32599 - YouTrack - JetBrains
With this configuration, WebStorm uses the grammar described in the TexMate bundle to parse and highlight the code. For WebStorm, it's not a...
Read more >gatsby-plugin-mdx
gatsby-plugin-mdx is the official integration for using MDX with Gatsby. MDX is markdown for the component era. It lets you write JSX…
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@JDansercoer Hopefully, Prettier 2.0 will be out in January. Follow #6888 for details. As for installing from GitHub, see https://docs.npmjs.com/cli/install.
@detj
https://github.com/prettier/prettier/pull/6773
Playground