Gatsby build with custom Template path and components resulting in a 404

Ever since Netlify started automatically installing gatsby-adapter-netlify our custom Template page is being generated as [...].html instead of index.html resulting in a 404 when viewing page(s) from built site

The page is created in gatsby-node.js as follows

  const CheckoutPageTemplate = path.resolve(`src/templates/checkout.tsx`)
    path: process.env.GATSBY_PREFIX_PATH
      ? `${process.env.GATSBY_PREFIX_PATH}/checkout/`
      : "/checkout/",
    matchPath: process.env.GATSBY_PREFIX_PATH
      ? `${process.env.GATSBY_PREFIX_PATH}/checkout/*`
      : "/checkout/*",
    component: CheckoutPageTemplate,

Can resolve this by renaming the […].html file to index.html after generation or locking gatsby to v5.10.0

However, both of these solutions are quite hacky and not ideal in long run

If you’ve confirmed this is an issue with the adapter, feel free to add it to: Gatsby Adapters causes regressions & issues with headers & redirects for NETLIFY builds on >=5.12.0 · Issue #38542 · gatsbyjs/gatsby (

Not sure why locking Gatsby to 5.10 is a hacky solution though.

Thank you for that link, will add it there as well.

For locking the version, we want to avoid locking the version (at least so explicitly) in order to make upgrades and improvements in other packages that depend on gatsby

Especially since this issue is only occuring on netlify itself and works fine when built and run locally

It’s a minor version (5.11 vs 5.12). I’d be surprised if something that works with 5.12 doesn’t work the same way with 5.11.