4 ms·
I ran into a fun one like that many years ago in IE. The JavaScript I had written was failing, but when I opened up the devtools to debug it, it worked. It tur
by rpeden 8y ago
I ran into a fun one like that many years ago in IE. The JavaScript I had written was failing, but when I opened up the devtools to debug it, it worked.
It turned out that in that version of IE, the console object only existed when the devtools were open. So a stray console.log call was causing an exception because console was undefined. But when I opened the devtools to see what was going on, console existed and so everything ran just fine.
I suppose that's the kind of error that only bites you once. When you know about it, you tend to never make that mistake again. But that first time you run into it can cause a painful few hours of head scratching and attempted debugging.
Funnily enough, I ran into a React Native error like the one described in the article, where something worked only while debugging. My previous experience with the heisenbug in IE led me to immediately dig into what was different in RN with the devtools open vs without them. So in a way, those hours I wasted in IE back in 2010 prevented me from potentially wasting hours debugging RN in 2017.
- gm-conspiracy 8y agoBeen bitten by the console bug as well.
- r32a_ 8y agoI've experienced this console.log bug too
- fiiv 8y agoBeen there, that same bug. This one bit a lot of people I think!
- MrRubbish 8y agoI’ve never been bitten by this one.
- exclusiv 8y agoYeah unless you wrap console log you just do this: window.console && console.log('debug msg'); In older Android versions, warnings in modern versions actually crash React Native apps. Can be very frustrating.
- vanadium 8y ago"It turned out that in that version of IE, the console object only existed when the devtools were open. So a stray console.log call was causing an exception because console was undefined. But when I opened the devtools to see what was going on, console existed and so everything ran just fine." Flashbacks commencing.
- kaixi 8y agoProgramming doesn't change that much after all. gRPC is just a modern SOAP. There, I said it.
- rpeden 8y agoModern SOAP doesn't sound too bad to me! But then again, I never found SOAP to be all that bad. I might have been lucky, though. Every time I had to use SOAP, it was just a matter of auto generating a client interface in whatever language I happened to be working in and then proceeding from there. I suppose not everyone was so fortunate.
- zxcmx 8y agoI found that autogeneration rarely worked well unless the client and the server were using the same tooling. The monstrous flexibility of xml and soap meant that in practice every soap server interface I had to consume had some quirk or incompatibility with the client I was trying to use. The worst offender was security extensions.
- sebazzz 8y agoI had a bug that was even worse, and I never found a workaround for IE11. In this case I had some kind of progress bar that was updated while a report is being generated. When the report is completely generated, the progress bar is replaced by a button. Except in IE11. At some point the progress bar stopped updating and it never turned into a button. Until you opened the developer tools and IE11 "flushes" the DOM and paints the new situation. So, never having found the cause, we recommended that (internal) customer to use F12 regularly on that page.