Closed mcconkiee closed 5 years ago
You should create the mdx
files for each component and make sure you have the right path on your gatsby-config
file
Hi @mcconkiee. It appears that by default gatsby-mdx
only looks for files with extension .mdx
. If you only have .md
files, this error is thrown: I think this is due to the fact the plugin fails to find any nodes on your filesystem (i.e. no .mdx
files).
To solve this you can either:
.md
files to .mdx
, orgatsby-mdx
config to tell it to look for .md
files as well. In your gatsby-config.js
, add the extensions
option to the gatsby-mdx
plugin:// ... other plugins
{
resolve: 'gatsby-mdx',
options: {
extensions: ['.mdx', '.md'],
},
},
See: https://gatsby-mdx.netlify.com/api-reference/options/extensions
Credit to this repo, where i first discovered the extensions config option and which led me to track down the official docs above: https://github.com/daneden/daneden.me/blob/master/gatsby-config.js
@tgallacher cleared this up 👏 thanks
You have to have MDX files to use MDX, it doesn't support regular MD files at the moment. It's the only thing preventing this theme from being a complete "drop-in" solution for most component libraries that use standard MD files for docs (albeit not that much of a limitation mass-renaming).
Closing this for now, but I'll make sure to try to clarify it in the README that MD files are not read. If anyone has any recommendations, please feel free to fork the README 👍
Hi, i'm getting the following error on vanilla install...I've followed the docs as the read for adding to an existing project - My project does not have any mdx files, only js....is that my issue?
Let me know what else i can provide.