You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MDX parsing error for components that are not self-closing (fixed, but not yet released) #7176
lang:mdxIssues affecting the MDX extension to Markdown (not general Markdown issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.type:duplicateIssues that are a duplicate of a previous issue
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 🙏
@kachkaev Not sure if this is a worthy addition to the discussion, but downgrading to 1.18.2 does not solve it. So maybe there's another underlying problem?
["INFO" - 12:38:24 PM] Formatting /xx/src/pages/index.mdx
["INFO" - 12:38:24 PM] Loaded module '[email protected]' from '/xx/node_modules/prettier/index.js'
["INFO" - 12:38:24 PM] Using ignore file (if present) at /xx/.prettierignore
["INFO" - 12:38:24 PM] File Info:
{
"ignored": false,
"inferredParser": "mdx"
}
["INFO" - 12:38:24 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 12:38:24 PM] Prettier Options:
{
"filepath": "xx/index.mdx",
"parser": "mdx",
"singleQuote": true,
"trailingComma": "es5",
"proseWrap": "always"
}
["ERROR" - 12:38:24 PM] Error formatting document.
Void elements do not have end tags "Link" (1:45)
Also using the same code example as said in the OP.
@JDansercoer Try installing Prettier master from GitHub ("prettier": "prettier/prettier" instead of "prettier": <version number> in your package.json).
@thorn0"prettier/prettier" seems to work, thanks! Any idea when it will be released?
Also, maybe little bit off-topic, but how does the resolving to "prettier/prettier" work? Can't seem to find documentation on that. I only remember every including a direct link to Github?
changed the title [-]MDX parsing error for components that are not self-closing[/-][+]MDX parsing error for components that are not self-closing (fixed, but not yet released)[/+]on Jan 9, 2020
@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).
lang:mdxIssues affecting the MDX extension to Markdown (not general Markdown issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.type:duplicateIssues that are a duplicate of a previous issue
Activity
kachkaev commentedon Jan 6, 2020
Indeed there is something strange happening with MDX in Prettier 1.19.1
✅
<Linc to="x">y</Linc>❌
<Link to="x">y</Link>✅
<div foo="bar">abc</div>❌
<div foo={{ bar: true }}>abc</div>✅
<></>✅
<Playground></Playground>❌
<Playground><></></Playground>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)
kachkaev commentedon Jan 6, 2020
The above issues could have been fixed by #6949. Playground for that PR:
✅
<Link to="x">y</Link>✅
<div foo={{ bar: true }}>abc</div>✅
<Playground><></></Playground>Looking forward for 1.19.2 / 1.20.0 / 2.0.0 👀 🙏
thorn0 commentedon Jan 6, 2020
Duplicate of #6943
thorn0 commentedon Jan 6, 2020
Yes, fixed, but not yet released. Let's keep this issue open for a while, so that people can see it.
JounQin commentedon Jan 6, 2020
Sorry for my fault, it reminds me that any changes of such OSS effect a lot of users.
Cheers.
RareSecond commentedon Jan 9, 2020
@kachkaev Not sure if this is a worthy addition to the discussion, but downgrading to
1.18.2does not solve it. So maybe there's another underlying problem?Also using the same code example as said in the OP.
thorn0 commentedon Jan 9, 2020
@JDansercoer Try installing Prettier
masterfrom GitHub ("prettier": "prettier/prettier"instead of"prettier": <version number>in yourpackage.json).RareSecond commentedon Jan 9, 2020
@thorn0
"prettier/prettier"seems to work, thanks! Any idea when it will be released?Also, maybe little bit off-topic, but how does the resolving to
"prettier/prettier"work? Can't seem to find documentation on that. I only remember every including a direct link to Github?thorn0 commentedon Jan 9, 2020
@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.
[-]MDX parsing error for components that are not self-closing[/-][+]MDX parsing error for components that are not self-closing (fixed, but not yet released)[/+]detj commentedon Feb 10, 2020
Is this error related to this issue?
Playground
fisker commentedon Feb 10, 2020
@detj
#6773
Playground
robinmetral commentedon Feb 24, 2020
@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).
thorn0 commentedon Feb 24, 2020
It has been fixed.
robinmetral commentedon Feb 25, 2020
Not in the
latest, playgroundmillette commentedon Feb 25, 2020
@robinmetral Hello Robin :-)
It's fixed in master, you can install (if you like bleeding edge, or just to test it):
After, you should see in package.json:
{ "dependencies": { "prettier": "github:prettier/prettier" } }Amongst others.
It works for me ™
robinmetral commentedon Feb 25, 2020
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 😉
fisker commentedon Feb 27, 2020
I think #6949 is the one
Update prettier to work around MDX bug