Skip to content
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

TypeError on iOS with timbre console appender, react-14 & cordova-plugin-console #165

Closed
mccraigmccraig opened this issue Apr 18, 2016 · 2 comments

Comments

@mccraigmccraig
Copy link

mccraigmccraig commented Apr 18, 2016

this seems to be a complex interaction, and i don't have a full explanation, but i'll leave what i have here to focus any further reports

i upgraded my app to react-14 (via reagent-0.6.0-alpha) and started getting a TypeError only on iOS during timbre logging, specifically with the console appender

downgrading to react-13, removing the timbre console appender and removing the cordova-plugin-console all make the problem go away. cordova-plugin-console modifies the js/console object to forward output to the app log, and react-14 is presumably also modifying the js/console object in some other way, otherwise downgrading to react-13 wouldn't achieve anything

sticking with react-13 is not an option, and both the other options mean that cljs logging no longer gets output to the app log, which i can live with for the moment

the error is happening here (in the generated js, which is all i'm getting from safari remote debugger) :

https://www.refheap.com/59720c5b42383ea78710caff0#L-21

which looks like it corresponds with here :

https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/appenders/core.cljx#L135

@mccraigmccraig
Copy link
Author

on further investigation this error seems to happen because cordova-plugin-console and/or react-14 are swapping out the js/console object, but the timbre console-appender is hanging on to an old version of the object in the closure around the appender-fn

https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/appenders/core.cljx#L115

this version of the appender which doesn't hang on to stale log functions works ok

https://www.refheap.com/a18d43d1a794234fc86f9be56

@ptaoussanis
Copy link
Member

Thanks for the report!

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

No branches or pull requests

2 participants