docz insists on trying to parse README.md as mdx no matter how it's configured
To Reproduce
npx create-docz-app docz-readme-bug
cd docz-readme-bug
echo >> README.md
echo '<img src="https://placekitten.com/200/300" width=200>' >> README.md
npm run dev
results in
ERROR #98123 WEBPACK
Generating development JavaScript bundle failed
unknown: JSX value should be either an expression or a quoted JSX text (30:49)
28 | <pre><code parentName="pre" {...{"className":"language-sh"}}>{`yarn serve # npm run serve
29 | `}</code></pre>
> 30 | <img src="https://placekitten.com/200/300" width=200>
| ^
31 | </MDXLayout>
32 | )
33 | };/home/aron/src/docz-readme-bug/README.md: unknown: JSX value should be either an expression or a quoted JSX text (30:49)
28 | <pre><code parentName="pre" {...{"className":"language-sh"}}>{`yarn serve # npm run serve
29 | `}</code></pre>
> 30 | <img src="https://placekitten.com/200/300" width=200>
| ^
31 | </MDXLayout>
32 | )
33 | };
File: ../README.md:30:49
failed Building development bundle - 3.565s
This configuration should help in theory:
// doczrc.js
export default {
files: ['**/*.mdx'], // should not find README.md
ignore: ['README.md'], // should also ignore README.md
}
...but running npm run dev results in the same error as before.
Environment
Demo repo at https://github.com/agriffis/docz-readme-bug
Did anyone find a way to solve this ?
@0phoff I switched to storybook for my needs. I like the look and simplicity of docz but it's more important for my current project to have stability and critical mass. I would be very happy if docz fixes this and becomes a good alternative in the future, though.
Same issue:
export default {
ignore: ['README.md', 'changelog.md', 'code_of_conduct.md', 'contributing.md', 'license.md'],
files: 'docs/*.{mdx}'
}
Same happened to me, I think I may found the root cause https://github.com/doczjs/docz/issues/1510
The issue is particularly an issue in my case because when docz it's deployed with Heroku for some unknown reason it tries to render CHANGELOG.md file from node, this is of course not a Gatsby issue but how Heroku works inside, but if the ignore setting would work correctly this wouldn't happen as it would be ignored by default.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Same happened to me, I think I may found the root cause https://github.com/doczjs/docz/issues/1510
The issue is particularly an issue in my case because when docz it's deployed with Heroku for some unknown reason it tries to render
CHANGELOG.mdfile from node, this is of course not a Gatsby issue but how Heroku works inside, but if theignoresetting would work correctly this wouldn't happen as it would be ignored by default.