-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-plugin-mdx] getting Cannot read property '__reactstandin__key' of null
from react-hot-loader when i accidentally render undefined
to MDXRenderer from gatsby-plugin-mdx
#16481
Comments
Cannot read property '__reactstandin__key' of null
from react-hot-loaderCannot read property '__reactstandin__key' of null
from react-hot-loader when i accidentally render undefined
to MDXRenderer from gatsby-plugin-mdx
Cannot read property '__reactstandin__key' of null
from react-hot-loader when i accidentally render undefined
to MDXRenderer from gatsby-plugin-mdxCannot read property '__reactstandin__key' of null
from react-hot-loader when i accidentally render undefined
to MDXRenderer from gatsby-plugin-mdx
Same here +1 |
@pierrenel do you see the fix? just make sure you're not rendering undefined. or if you can provide further investigation, please help so that @ChristopherBiscardi has more info to work with |
ah no - I didn't see the fix - but I'm not using mdx, this is a fresh project using styled components - I get the error when trying to wrap |
+1 for styled-components' ThemeProvider. |
CC @johno |
Same issue here with |
In my case the error is:
|
I'll open up a PR/fix for MDX's side today, though this is something that happens in other circumstances as well. I've seen this occur more generally, if you pass
Can anyone reproduce the |
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.
Well this is awkward... See if wrapping a single child instead of multiple children in the |
Hi @johno ! Thanks for looking at this problem. I reproduced the error with |
Thank you @CRNRSTD, you addressed the issue, and a little |
same issue in my electron application. Node v12.3.0
electron v6.0.2
npm v6.9.0
"react-hot-loader": "v4.12.11",
"react": "16.9.0", |
How I got the error:
Quickfix:
It seems that this issue is caused by However, in the docs
|
In my case, old |
same error in a simple gatsby site
|
I faced the same error. The following two steps helped me:
The issue seems to be related to not invalidating import cache by gatsby. |
react-tabs for me using Gatsby. Tried removing .cache, reinstalling and updating packages, using <> and within {children}. Nothing.
|
May or may not be related but I was getting this error after having not exported the component before using it. |
searchers using react-hot-loader may find themselves here, so: this is almost definitely because:
to more easily debug this, turn off react-hot-loader and get react's native error message, which will probably tell you which component is undefined |
In my case the error is:
I noticed that only half of my posts are rendered when I run
Edit I downgraded |
I also get this error as soon as I use anything from react-stripe-elements. Any ideas on what to do? |
Had the same issue with |
This error was fixed for me when I realized I was not importing with brackets - import { component } from './component'. |
@isaacdpierce I second this, ran into this issue when using sanity's block-content-to-react and Theme UI, which also relies on a |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing! Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing! Thanks again for being part of the Gatsby community! |
Description
i'm starting to get these a lot:
i think this is new? and i searched and didnt find a related issue and so i am filing this.
after some investigation i think i found the cause. see below
Steps to reproduce
i think this happens when you accidentally pass
undefined
to MDXRenderer fromgatsby-plugin-mdx
. the error message is waaaay unintuitive and should be improved.Expected result
we should have a more descriptive error.
Environment
The text was updated successfully, but these errors were encountered: