samdenty / console-feed

Captures console.log's into a React Component 🔥
https://stackblitz.com/~/github.com/samdenty/console-feed
MIT License
662 stars 110 forks source link

Method of undefined issues in new versions #62

Open arthurdenner opened 3 years ago

arthurdenner commented 3 years ago

I'm investigating what was reported on #61 within CodeSandbox. I tried to upgrade to the newest version (3.1.9) and now we're getting Cannot read property 'toUpperCase' of undefined in some cases.

I think that instead of https://github.com/samdenty/console-feed/commit/9acd017d4d64dfdf875d1d5e5037c51d0fd5b1c5, we should check for !error in the Error component and return The error you provided does not contain a stack trace..

The original issue that triggered my investigation is https://github.com/codesandbox/codesandbox-client/issues/4963 - we were getting a blank error message there, then we got indexOf of undefined and now toUpperCase of undefined.

What do you think about my suggestion? The error you provided does not contain a stack trace. is what we get in the browser console inside CodeSandbox, so the behaviour would match in our case I think.

I tried to create a reproducible example in the demo app to verify the behaviour with more scenarios but I couldn't get to the state reported in https://github.com/codesandbox/codesandbox-client/issues/4963.

samdenty commented 3 years ago

believe this is an emotion version issue, @SaraVieira what did you do to fix this previously?

samdenty commented 3 years ago

https://github.com/samdenty/console-feed/commit/de41ef2662019c645a652199d9bdbbfc71419f5e should fix https://github.com/codesandbox/codesandbox-client/issues/4963

arthurdenner commented 3 years ago

Alright. I'll try with 3.1.10.

SaraVieira commented 3 years ago

Yeah, this was an emotion issue, cleaning and running yarn again should fix it.

Make sure to delete the yarn file :/

SaraVieira commented 3 years ago

@samdenty Still does not seem to be fixed :(

marmos91 commented 3 years ago

I am experiencing the same issue :(

zdllucky commented 2 years ago

I had this problem when passing incompatible log object. Some loggers today have key level instead of method, what was exactly my case.