Skip to content

Conversation

Roilan
Copy link
Collaborator

@Roilan Roilan commented May 3, 2016

As I'm building out a email template system with this module, I've noticed that warning message doesn't specify where it comes from. At the moment, we assume everything is one giant component, which we shouldn't.

I'm currently digging through module.parent but if you have a better way / idea of finding the root source, please share!

@chromakode
Copy link
Owner

Trying to understand the use case here -- do you want to know that this warning is coming from react-html-email, or the exact file the warning came from? I think changing the text to be like "Warning (react-html-email):" would be a good idea, but I'm a little hesitant to add the complexity of resolving the filename.

I haven't seen other modules behave like this; for instance React will also output warnings without a mention of their origin file. I wonder if this is something you could implement more generally for your application purposes by monkeypatching console.warn/console.log to inspect the stack?

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.

2 participants