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

programmatically-creating-pages - path.rsolve require.resolve #395

Closed molebox closed 5 years ago

molebox commented 5 years ago

path.resolve doesnt work and produces the error - The plugin "my-theme" tried to create a page that doesnt exist". Changed to require.resolve and it works.

This was following the docs C/P

molebox commented 5 years ago

Yeah i was doing it in a theme. Im not 100% on why this change worked so if im jumping up the wrong tree then do say so!

But once i made this change everything worked for me. I got the tip from another issue (cant find it again). Thought i would mention it, maybe its nothing..

ChristopherBiscardi commented 5 years ago

This change was required because paths work differently in themes (because they're npm packages). Closing this here.