Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby-plugin-mdx): Raise error if MDXRenderer receives undefined or null #16555

Merged

Conversation

johno
Copy link
Contributor

@johno johno commented Aug 12, 2019

We should validate that MDXRenderer receives a transpiled MDX
string. If we don't, we should error out with a useful error
message.

This is related to #16481, but doesn't completely solve all causes.
An additional PR will follow later.

We should validate that MDXRenderer receives a transpiled MDX
string. If we don't, we should error out with a useful error
message.

This is related to gatsbyjs#16481, but doesn't completely solve all causes.
An additional PR will follow later.
@johno johno requested a review from a team as a code owner August 12, 2019 14:47
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably improve the check iteratively to really assert that we received an MDX string but this is better than nothing!

Thank you John 💜

Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sidharthachatterjee sidharthachatterjee changed the title fix(gatsby-plugin-mdx): Raise error if MDXRenderer received undefined fix(gatsby-plugin-mdx): Raise error if MDXRenderer receives undefined or null Aug 13, 2019
@sidharthachatterjee sidharthachatterjee merged commit aa03d44 into gatsbyjs:master Aug 13, 2019
@johno johno deleted the validate-mdx-renderer-input branch August 13, 2019 16:56
johno added a commit to johno/gatsby that referenced this pull request Aug 13, 2019
This deviates from React conventions and there are valid usecases
where content passed to MDXRenderer might be stateful meaning that
it might be undefined at some point.

Related/reverts gatsbyjs#16555
johno added a commit to johno/gatsby that referenced this pull request Aug 13, 2019
This deviates from React conventions and there are valid usecases
where content passed to MDXRenderer might be stateful meaning that
it might be undefined at some point.

Related/reverts gatsbyjs#16555
gatsbybot pushed a commit that referenced this pull request Aug 13, 2019
This deviates from React conventions and there are valid usecases
where content passed to MDXRenderer might be stateful meaning that
it might be undefined at some point.

Related/reverts #16555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants