I asked this question on the Turbolinks GitHub page last week as I kept experiencing this bridge injection failure issue.
The issue is extremely intermittent and is very challenging to reproduce, but the code of the problem is that on some devices, we we see the Turbolinks Bridge Injection Failed
error and our page subsequently fails to load properly.
There's too much code to post here (not to mention NDA restrictions), but suffice it to say that the page is being loaded on the majority of devices and on the ones that fail, we notice a 401
exception from our server due to bad authentication details and then this callback fires off.
Does anyone know why a Bridge Injection issue would occur on some devices, but not on others?
As it turns out, the issue lies not anywhere in my code nor in turbolinks, but is directly correlated to users having the Chrome Browser installed.
I ran countless data logs and tests to confirm, but the upshot is this:
Turbolinks will not work properly if the device:
1) Does not have Chrome installed
2) Has Chrome Disabled
3) Has an outdated version of Chrome that requires an update (no specific minimum version from what I could find, more just a generic, an update needs to happen after X versions).
In any of the 3 situations, this
Bridge Injection Error
will fire off and that is unquestionably the cause.The solution is to redirect the user to the Play store via their device and instruct them to either download, enable, or update Chrome.
Why this is required when neither Turbolinks nor my forked version use the WebChromeClient is not something I fully understand.
As a quick disclaimer : I am sure you can get Turbolinks to work fine in some situations that do not do all that we were doing server-side, but in our situation, this was the lynchpin that was causing issues.