Skip to content
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

Comments without new line above result in babel error #244

Closed
DavidWells opened this issue Aug 31, 2018 · 1 comment
Closed

Comments without new line above result in babel error #244

DavidWells opened this issue Aug 31, 2018 · 1 comment
Labels
🐛 type/bug This is a problem

Comments

@DavidWells
Copy link

Ref: #184 (comment)

It looks like this is working for most comments but I just ran into an error with comments in MD

The markdown looks like this:

# login

<!-- AUTO-GENERATED-CONTENT:START (TOC) -->
- [login](#login-1)
<!-- AUTO-GENERATED-CONTENT:END -->

It replaces the top <!-- AUTO-GENERATED-CONTENT:START (TOC) --> correctly but passes over the second comment <!-- AUTO-GENERATED-CONTENT:END --> because there is no newline

This results in a babel error:

Error: Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: Unexpected token (15:1)

  13 | <MDXTag name="li" components={components} parentName="ul">
  14 | <MDXTag name="p" components={components} parentName="li"><MDXTag name="a" components={components} parentName="p" props={{"href":"#login-1"}}>{`login`}</MDXTag></MDXTag>
> 15 | <!-- AUTO-GENERATED-CONTENT:END -->
     |  ^
  16 | </MDXTag>
  17 | </MDXTag>
  18 | {/* AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_DOCS) */}

I was able to work around it by adding a newline after the list. This markdown works because there is a newline after the list

# login

<!-- AUTO-GENERATED-CONTENT:START (TOC) -->
- [login](#login-1)

<!-- AUTO-GENERATED-CONTENT:END -->

Is there a way to support this without the newline? Thanks!

Loving MDX btw it's freaking sweet

@silvenon
Copy link
Contributor

silvenon commented Sep 20, 2018

Resolved with #260 and released in v0.15.3-0.

imchairmanm added a commit to prisma/docs that referenced this issue Mar 29, 2020
There were a few issues preventing the repo from building correctly:

1. Although it says this was resolved, the version of Gatsby we're using
doesn't seem to have this fix: mdx-js/mdx#244
Adding a new line was enough to make it work
2. There were a few unterminated `SwitchTech` instances.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 type/bug This is a problem
Development

Successfully merging a pull request may close this issue.

2 participants