ChristopherBiscardi / gatsby-mdx

Gatsby+MDX • Transformers, CMS UI Extensions, and Ecosystem Components for ambitious projects
https://gatsby-mdx.netlify.com/
715 stars 100 forks source link

Default Layout issue #412

Closed theonlydaleking closed 5 years ago

theonlydaleking commented 5 years ago

Describe the bug It seems the default layout option isn't working

To Reproduce Just about followed word for word from this guy's issue #34 a while back.

  1. npx -p gatsby-cli gatsby new site https://github.com/gatsbyjs/gatsby-starter-default
  2. cd site
  3. yarn add gatsby-mdx @mdx-js/mdx @mdx-js/tag @mdx-js/react
  4. yarn develop
  5. change gatsby-config.js to appropriate (see repo attached)
  6. change index.js to index.mdx
  7. Insert some MDX
  8. Layout drops off when you visit localhost:8000

Expected behavior Layout component is rendered

Screenshots can provide if needed

Additional context Repo that fails can be found here

scottmartin commented 5 years ago

Try this in your config.

options: {
  defaultLayouts: {
    default: require.resolve("./src/components/layout.js")
  }
}
theonlydaleking commented 5 years ago

Damn it, i had that in the main project and missed it when i setup the config for the test repo. Disregard - closing due to Id-10-T error

scottmartin commented 5 years ago

No problem. I'm glad I could help. I'm new to Gatsby and I'm neck-deep in setting all of this up myself.

theonlydaleking commented 5 years ago

yeah me too. Turns out on my main project, i had "defaultLayout" rather than "defaultLayouts" - god damn it.