JavaScript Uncaught ReferenceError: bmi_load is not defined

Found in logs

###Info

Uncaught ReferenceError: bmi_load is not defined
Url: http://example.com/
Line: 218
Window Location: http://example.com/

###Env

HTTP_HOST: example.com
REQUEST_URI: /logs/report_js_error
REQUEST_METHOD: POST
HTTP_USER_AGENT: Mozilla/5.0 (Linux; Android 4.4.2; en-gb; SAMSUNG SM-G900F Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.6 Chrome/28.0.1500.94 Mobile Safari/537.36
HTTP_ACCEPT: */*
HTTP_REFERER: http://example.com/
HTTP_X_FORWARDED_FOR: 1.2.3.235
HTTP_X_REAL_IP: 1.2.3.235

params:
  message: Uncaught ReferenceError: bmi_load is not defined
Url: http://example.com/
Line: 218
Window Locatio
  url: http://example.com/
  line: 218
  window_location: http://example.com/

###Also note
Strange miss-spelling of Window Location (Window Locatio)

Discourse version

Discourse 1.2.0.beta6 - https://github.com/discourse/discourse version 38279c79c9941426c579ea0ee133b27786cdf4c6

bmi_load doesn’t exist in our codebase. Are you embedding any other 3rd party Javascript?

I think I have found the source.
It being several users accessing the site via UK 3G/GPRS providers who modify the content.

https://kc.mcafee.com/corporate/index?page=content&id=KB52171

####Problem
SaaS Endpoint Protection fails to update and you see the following error message in the update window:
BMI_LOAD is undefined
The SaaS Endpoint Protection system tray icon eventually shows the error condition symbol.
####Cause
BMI_Load is a JavaScript used by various mobile vendors in General Packet Radio Service (GPRS) modem software. In other cases it is injected into HTML by mobile data carriers. This JavaScript reduces image quality to improve bandwidth over the GPRS connection. The BMI_Load JavaScript can conflict with SaaS’s JavaScript resulting in an error condition that prevents SaaS Endpoint Protection from completing the DAT update.

Possible solution

Consider adding Cache-Control "no-transform" header.

However this might have other ramifications in terms of intermediate caching servers, but as long as this isn’t included on the image files it shouldn’t have that much of an effect.

https://github.com/h5bp/server-configs-apache/blob/4c359776530f24f2dd690f6d01c915c8040b3cbe/src/web_performance/content_transformation.conf

EDIT: If a site is behind Google PageSpeed - this header would cause the page not to be rewritten, perhaps impacting CloudFlare sites too… personally I would prefer knowing the site is loaded without errors.

1 Like