-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
MDX parsing error for components that are not self-closing (fixed, but not yet released) #7176
Comments
Indeed there is something strange happening with MDX in Prettier 1.19.1 ✅ ✅ ✅ This seems to be a new behaviour in 1.19 – the above examples did work in 1.18.x. Sadly, we are blocked by these oddities in MDX and have to stick with 1.18 for now. Prettier 1.19 is required to start using TypeScript 3.7 awesome features, so if anyone has ideas, please help 🙏 cc @JounQin (author of #6332 and #6340, which are mentioned in 1.19 blog post) |
The above issues could have been fixed by #6949. Playground for that PR: ✅ Looking forward for 1.19.2 / 1.20.0 / 2.0.0 👀 🙏 |
Duplicate of #6943 |
Yes, fixed, but not yet released. Let's keep this issue open for a while, so that people can see it. |
Sorry for my fault, it reminds me that any changes of such OSS effect a lot of users. |
@kachkaev Not sure if this is a worthy addition to the discussion, but downgrading to
Also using the same code example as said in the OP. |
@JDansercoer Try installing Prettier |
@thorn0 Also, maybe little bit off-topic, but how does the resolving to |
@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. |
Is this error related to this issue? <div style={{width: '100px'}}></div> |
@thorn0 Isn't it misleading to close this when it hasn't been fixed? A better practice IMHO would instead be to reference it in the PR that will solve it (#6773 as far as I understand). |
It has been fixed. |
Not in the |
@robinmetral Hello Robin :-) It's fixed in master, you can install (if you like bleeding edge, or just to test it): npm install prettier/prettier After, you should see in package.json: {
"dependencies": {
"prettier": "github:prettier/prettier"
}
} Amongst others. It works for me ™ |
Thanks for the info Robin @millette 🙂 Can you point me to which PR fixed it? Another follow-up question would be why a bugfix merged to master doesn't trigger a release 😉 |
I think #6949 is the one |
Have to use the github version of prettier right now because parsing of every markdown file with the tabs component fails otherwise. prettier/prettier#7176
Prettier 1.19.1
Playground link
Input:
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):
It seems that the error is coming from the component not being self-closing.
The text was updated successfully, but these errors were encountered: