Skip to content

MDX / MD issue (Index.html is not built on new projects) #49

Open
@chrisflatley

Description

@chrisflatley

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions