Open
Description
What happened?
Mdx vs Mx seems to have broken Markdown only sites.
If you have docs/index.md then index.html is not generated when built. So the resulting site is totally broken, although development seems to work.
If you have docs/index.mdx then you get an index.html.
I also get numerous errors (with 3.14):
warn The GraphQL query in the non-page component "/app/node_modules/@committed/gatsby-theme-docs/src/layout/docs.tsx" will not be run.
Exported queries are only executed for Page components. It's possible you're
trying to create pages in your gatsby-node.js and that's failing for some
reason.
If the failing component(s) is a regular component and not intended to be a page
component, you generally want to use a <StaticQuery> (https://gatsbyjs.org/docs/static-query)
instead of exporting a page query.
If you're more experienced with GraphQL, you can also export GraphQL
fragments from components and compose the fragments in the Page component
query and pass data down into the child component — https://graphql.org/learn/queries/#fragments
And then basically no pages output.
What did you expect to happen?
md and mdx behave the same.
Any relevant technical information (OS, versions, logs)?
gatsby 3.14.5, node 16 and docs 3.1.0.
Note this works on gatsby 3.8.0, so must be an API change.
However, I have found it almost impossible to get 3.8.0 pinned with npm. When running Docker npm ci I often get 3.14 which causes this bug to occur.
Possible related:
- no index.html file in public folder after building gatsbyjs/gatsby#21843. I can confirm that added srcpages/index.js to the docs template (in node_modules) dir does render apage. So I assume this is the fix, however, I'm not entirely sure what to put that file. It's not the content of layout/index.js.
- https://stackoverflow.com/questions/55564792/no-index-html-file-after-gatsby-cli-build