-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Make createElement(undefined) warning more descriptive #7307
Comments
If you intend to work on this, please write in a comment here. The change to the code is very small so most of the effort would be spent on creating a good warning page explaining common problems and solutions. Here is an example of such warning page: https://github.com/facebook/react/blob/master/docs/warnings/legacy-factories.md. This one would be similar (but about a different topic). |
Can I look into this? |
Sure! |
I’m “assigning” myself so I keep track of this issue but it’s yours. |
Please include a stacktrace! |
@Pajn Will do! I'm bitten by the lack of information many times too, especially when dealing with HOC. Edit 7/26: didn't manage to find time last week to work on this, but will be doing that this week |
Similar: #7215. |
@jin Any updates? If you’re too busy, it’s fine—just let us know and we’ll ask somebody else to look into this! |
@gaearon Really sorry for losing track of this - please free this up for someone else. Took me a little too long to digest the React source. |
@jin Anything we can help you with? This should only involve changing these few lines. Also would love to hear your feedback on the confusing parts of the codebase. |
I can pick this up if you guys decide this needs a fresh pair of eyes. |
@gaearon Actually, I'm done with changing that warning to link to a warning docs page. Right now, I'm primarily blocked with coming up with the different examples/scenarios that the issue can occur in, on top of the ones you've mentioned. The codebase isn't confusing per se, it's the part of transforming my understanding from actual applications of React to the underlying implementations of them. |
@gaearon done! Happy to hear any feedback. |
As discussed in #7485, I think we should also report /what/ value we saw, rather than just a list of forbidden types. Compare
with:
|
Hi all, really really sorry for the delayed response: I'm moving between cities these couple of weeks, haven't had the chance to sit down to address the feedback yet. I expect the move to settle down by the middle of next week, and will resume progress ASAP.
|
@jin, have you made any progress on this issue? If you are too busy, I would love to take a stab at it. |
I'll take a look |
For me, this error is almost always a chore in finding the component that it's referring to. It'd help if the error message did better to identify that component. Maybe it'd help to display everything known about the element? Such as props, or the location of the element in the component hierarchy (perhaps a parent)?
Is something like that feasible and desirable? |
@gravitypersists It just needs to explicitly say that it is undefined (rather than some obscure error) when |
Is this still being worked on or can I maybe try to take a stab at it? |
@joelseq I totally dropped the ball on this one, sorry! Please take over if
you'd like to!
…On Mon, Dec 5, 2016 at 12:26 AM Joel Sequeira ***@***.***> wrote:
Is this still being worked on or can I maybe try to take a stab at it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7307 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAVPDiwSsIeKR8BZdYqveR6DP9EOGzBJks5rE6BygaJpZM4JQIG3>
.
|
Looks like there hasn't been any activity for a few weeks. Anyone mind if I claim this for now? |
Update: claimed by @jin
This is what I see when I mistype an import:
This is not very useful.
When
type
isundefined
, we should provide a better message. In 95% of cases it is caused by an invalid import. We should create a page explaining common cases how this could happen (e.g. mismatching default/named export, forgetting to export the component, or importing a non-existing named export), and link to that page from the warning.The text was updated successfully, but these errors were encountered: