Closed jakehopking closed 4 years ago
Can you try to move your .mdx "page" out src/pages
to anywhere else just so it's not under src/pages
(and likely adjust slug creation after it)?
I think there is some race condition here, because gatsby-plugin-mdx
will automatically create pages from .mdx
if it's in src/pages
, but then you also create pages yourself for same "paths" (but using different template - the default).
I think this work in develop because we do rerun createPages
potentially multiple times, but we don't in builds - so I assume in builds auto-creation by mdx "wins" (or runs last) and in develop createPages
"wins", because it's called after auto-creation as well
@pieh Thanks for your thoughts on this. I was hoping not to have to move things to a new folder structure, but so be it. I've followed your suggestion and all templates are rendering correctly now.
it seems to be an obnoxious problem with gatsby that happens to me probably every single project now. its really unacceptable of them to not fix this.
Description
When running
gatsby build
the site cannot create pages using a defined template for:allMdx(filter: {frontmatter: {category: {eq: "page"}}})
.However it works with the same exact code for:
allMdx(filter: {frontmatter: {category: {eq: "episode"}}})
type.When running
gatsby develop
, both templates are successfully used to build pages.Steps to reproduce
Run
gatsby build
on my projecthttps://github.com/jakehopking/uitherapy.fm
Expected result
Successfully build static site using defined templates.
Actual result
Build ignores the template for
{category: {eq: "page"}}
but does not ignore{category: {eq: "episode"}}
.Environment
gatsby-node.js
gatsby-config.js
templates/episodes.js (success)
templates/default.js (failure)
Any help would be massively appreciated. Thanks in advance :)