react: Make createElement(undefined) warning more descriptive
Update: claimed by @jin
This is what I see when I mistype an import:
This is not very useful.
When type is undefined, 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.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 11
- Comments: 24 (5 by maintainers)
Can I look into this?
Please include a stacktrace! This is the worst possible message to get after doing a big merge as there are absolutely nothing to guide you to where the problem can be.
I think this was fixed in #8612, and being further improved in #8495. Thanks for the offer to help though!
@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 notifications@github.com wrote:
As discussed in #7485, I think we should also report /what/ value we saw, rather than just a list of forbidden types. Compare
with:
@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
I’m “assigning” myself so I keep track of this issue but it’s yours.