prisma / docs

📚 Prisma Documentation
https://www.prisma.io/docs
Apache License 2.0
981 stars 772 forks source link

Committing with default configuration breaks .mdx files that it can not compile any more #3020

Open janpio opened 2 years ago

janpio commented 2 years ago

See this change: https://github.com/prisma/docs/pull/3019/files#diff-ded422aa67501e14bef8454eb8fa25fcac0c55b3f122a40be76f6622555df872L71-R71 I did not manually change that indentation, some precommit hook or other configuration change the formatting of that file in a way that it does not build any more:

error "gatsby-plugin-mdx" threw an error while running the onCreateNode lifecycle:

unknown: Expected corresponding JSX closing tag for <cmdResult>. (86:0)

  84 | <pre parentName="li"><code parentName="pre" {...{}}>{`  </cmdResult>
  85 | `}</code></pre>
> 86 | </CodeWithResult>
     | ^
  87 | <p parentName="li">{`   Your Prisma schema is now in sync with your database schema and you have initialized a migration history:`}</p>
  88 | <pre parentName="li"><code parentName="pre" {...{}}>{`migrations/
  89 |   └─ [20](https://github.com/prisma/docs/runs/5725077478?check_suite_focus=true#step:5:20)[21](https://github.com/prisma/docs/runs/5725077478?check_suite_focus=true#step:5:21)0[31](https://github.com/prisma/docs/runs/5725077478?check_suite_focus=true#step:5:31)31[40](https://github.com/prisma/docs/runs/5725077478?check_suite_focus=true#step:5:40)4[42](https://github.com/prisma/docs/runs/5725077478?check_suite_focus=true#step:5:42)_init//home/runner/work/docs/docs/content/200-concepts/100-components/03-prisma-migrate/index.mdx: unknown: Expected corresponding JSX closing tag for <cmdResult>. (86:0)

  84 | <pre parentName="li"><code parentName="pre" {...{}}>{`  </cmdResult>
  85 | `}</code></pre>
> 86 | </CodeWithResult>
     | ^
  87 | <p parentName="li">{`   Your Prisma schema is now in sync with your database schema and you have initialized a migration history:`}</p>
  88 | <pre parentName="li"><code parentName="pre" {...{}}>{`migrations/
  89 |   └─ 20210313140[44](https://github.com/prisma/docs/runs/5725077478?check_suite_focus=true#step:5:44)2_init/

  SyntaxError:unknown: Expected corresponding JSX closing tag for <cmdResult>.   (86:0)
    84 | <pre parentName="li"><code parentName="pre" {...{}}>{`  </cmdResult>
    85 | `}</code></pre>
  > 86 | </CodeWithResult>
       | ^
    87 | <p parentName="li">{`   Your Prisma schema is now in sync with your dat  abase schema and you have initialized a migration history:`}</p>
    88 | <pre parentName="li"><code parentName="pre" {...{}}>{`migrations/
    89 |   └─ 20210313140442_init//home/runner/work/docs/docs/content/200-concep  ts/100-components/03-prisma-migrate/index.mdx: unknown: Expected corresponding   JSX closing tag for <cmdResult>. (86:0)
    84 | <pre parentName="li"><code parentName="pre" {...{}}>{`  </cmdResult>
    85 | `}</code></pre>
  > 86 | </CodeWithResult>
       | ^
    87 | <p parentName="li">{`   Your Prisma schema is now in sync with your dat  abase schema and you have initialized a migration history:`}</p>
    88 | <pre parentName="li"><code parentName="pre" {...{}}>{`migrations/
    89 |   └─ 20210313140442_init/

https://github.com/prisma/docs/runs/5725077478?check_suite_focus=true#step:5:35

janpio commented 2 years ago

In this case the workaround might have been to put a proper <!-- prettier-ignore-start --> and ` around these lines, with no indentation so it actually gets read and activated.