Gatsby MDXRenderer: Error Element type is invalid: expected a string #38831
Labels
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
I have been working on a simple wiki style static page using gatsby.
versions:
I already have almost everything working as intended, i have pages being created at build time from mdx files in a contents folder using MDXProvider in a template component and passing it children.
but now i have a landing page (index.js) for the website, where i have some custom components, and under the components i want to include some text which would also come from a mdx file in the content folder.
to render it i think i need to use MDXRenderer, but i keep getting the same error, no matter what i try.
error:
to try and figure out if there might be some thing interfering i tried creating a very simple project using
npm init gatsby
but i still get the same error.this is what i have so far:
index.js
gatsby-config.js:
landingPage.mdx:
I have tried going through multiple gatsby/dependency versions, so far the only version that seems to work somewhat is when i use gatsbyv2 and accompanying plugins/dependencies, i am not too sure if i am missing something, i have tried looking through the documentation and i couldn't find anything that applies to my specific use case.
Reproduction Link
https://github.com/MrBen777/gatsby_issue
Steps to Reproduce
Use MDXRenderer to render contents of mdx file
Expected Result
contents show up as expected and formatted correctly
Actual Result
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: