I've been using mdx via the docz project and I was going to add a page for our changelog on a monorepo project that gets generated by lerna, but it appears that the Markdown file generated is not parseable by mdx.
Syntax Error: SyntaxError: /Users/wellingtoncordeiro/Documents/projects/my-proj/CHANGELOG.md: Expected corresponding JSX closing tag for <MDXTag> (24:0)
22 | Features
23 |
> 24 | </a>
| ^
25 | Change Log
26 | (2018-09-04)
27 |
@ ./docs/changelog.mdx 9:0-40 22:25-34
Example MD that broke when parsed.
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="11.0.1"></a>
## [11.0.1](https://gitlab.com/group/proj/compare/v11.0.0...v11.0.1) (2018-09-10)
### Bug Fixes
This may well be a problem with the Markdown that Lerna/commitizen generates and if so I can report upstream but it seems weird to break on the tag.
For some reason remark parses tags differently based on if they are in one line. I will look for a way to fix this.
An easy workaround is to put </a> on a new line, I think that should work.
I was unfortunately not able to reproduce the issue (my previous comment suggested that I actually tried it). I used that exact same code and it compiled exactly as expected.
Could you please share provide a minimal demo reproducing this issue?
In the meantime I will close this issue because I suspect that something else in your setup is the issue, but I will reopen once we can confirm the bug.
@silvenon this is via docz that seems to be running on 0.15. I'll report there and see if it's the env they have.
https://github.com/pedronauck/docz/blob/master/packages/docz/package.json#L29
Maybe don't raise the issue yet, this works fine for me:
yarn add docz
touch index.mdx
# add the changelog content
yarn docz dev
So it might not be a problem with docz. (I'm using [email protected] here.)
Could you provide a repository with docz reproducing this error?
@silvenon I saw the problem specifically when I did the following.
docs/changelog.mdx
name: Changelog
route: /changelog
---
import Changelog from '../CHANGELOG.md';
<Changelog />
I tried this as well. My project tree:
docs/
changelog.mdx
CHANGELOG.md
package.json
CHANGELOG.md:
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="11.0.1"></a>
## [11.0.1](https://gitlab.com/group/proj/compare/v11.0.0...v11.0.1) (2018-09-10)
### Bug Fixes
docs/changelog.mdx:
name: Changelog
route: /changelog
---
import Changelog from '../CHANGELOG.md'
<Changelog />
This works fine. If you create a new repo and do these same steps, does it not work for you? You have to help me out here if you want your problem solved.
You have to help me out here if you want your problem solved.
I have been. Here's a repo, it has literally the slightest difference and breaks, really hate when people act like you aren't being helpful when you bring examples, stack traces and are responsive to them.
Sorry for my tone. I spent a lot of time trying to reproduce this bug because the code you provided wasn't the breaking code. I was hoping to spend that time _fixing_ the bug.
This last demo proves that the changelog causes a syntax error in docz, but not in MDX itself, so maybe it has something to do with the way that MDX is used in docz. It seems like an obscure edge case, so I will keep this open just in case it comes back to MDX, but let's continue tracking this in your docz issue. pedronauck/docz#336
Thanks @silvenon sorry as well. I see you found a few breaking variants
I'll close this issue for now because we haven't found out how to reproduce it in mdx, only docz, so it should be tracked there.