Just because it works in Chrome, doesn't mean your code is correct

Here at earthware we really like using Aurelia as our go to JavaScript SPA framework.

We recently came across an interesting bug on a project we were using the framework on, where the code worked perfectly in Chrome but failed to render anything in any other browser. Upon further investigation, we found we weren't the only ones and came upon the following bug report on Aurelia's github repository: https://github.com/aurelia/binding/issues/250

The framework author pointed out the mistake in the reporter's code, but the replies comes back:

"But it works in Chrome!"

Chrome still has the best developer experience of all browsers in my opinion and I'm sure lots others would agree, so we often fall into this trap:

  1. Write some code
  2. Test in Chrome
  3. See the desired result
  4. Assume our code is syntactically correct and has no errors

The framework authors response:

"I have no clue why it works in Chrome. It shouldn't."

Worth keeping in mind during development, don't assume Chrome always does things right!